How do I run a php script from the command line?
No matter what OS you have installed you need to compile / install php as a CGI because when you have php as a CGI you have a binary you can execute from anywhere like a command prompt. If you use a unix like OS you should do: /path/to/php -f /path/to/script.php For windows OS’s do: c:\path\to\php.exe -f c:\path\to\script.php The parameter -f is put on because we want to parse a file, the -f also implies -q which means you dont get any HTTP header output which in most cases is usefull when making command line scripts.