CakePHP: Running bake.php on Windows command line
I have been wondering why my bake.php is not working like it is suppose to be. After some debugging with the help of exit() and die(), I found out that PHP (v4.4.2) is not reading the arguments on the command line. After a quick google-ing, I found out that there’s a php.exe for CLI. It is different then the one on the PHP root directory. You can find out if the php.exe you are running from the command line is a PHP for CGI or PHP for CLI by: >php -v.
To run bake.php correctly on windows, you have to use PHP for CLI not PHP for CGI. On my system, PHP for CLI is residing in the PHP_ROOT\cli directory. So, what I did was renaming the php.exe in the CLI subdirectory to php-cli.exe, then add PHP_ROOT\cli into my PATH. Now, I can run bake.php with:
**>php-cli bake.php -h** this should display bake help file.
I hope the above information is helpful.




