PHP can/should be compiled as a binary, separate from the Web server, and installed in /usr/local/bin. That allows PHP scripts to be run, just the same as any other scripting language (Perl, sh, etc.)
Alternatively, put the script on a Web server and run wget or lynx --dump to invoke it.