1
votes

I'm using cakephp to develop my project and I want to create models using the command prompt as that is easier than creating models manually. As I'm using the windows environment. I edited the path in my computer/advanced settings/environment variable/system variable as below.

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\MySQL\MySQL Server 5.0\bin;C:\Program Files\TortoiseSVN\bin;C:\wamp\www\fit or fat\lib\Cake\Console;

(I have renamed my cakephp folder as fit or fat) But whwn I enter the 'cake bake ' command in cmd I'm getting the error message that cake is not recognized as an internal or external command. Is there anything else I have to do/

1
You don't need to modify your path (infact, I'd say it's a bad idea to do so) to use the cli, just cd path\to\app and (any os) Console\cakeAD7six

1 Answers

1
votes

In Windows you need to use cake.bat instead just cake which is for *nix.

Also you can run bake without environment variables setting just do the following

cd "C:\wamp\www\fit or fat"
lib\Cake\Console\cake.bat bake

but you need to setup correct correct path to your php anyway.

If you want to just run bake without any setting do the following

cd "C:\wamp\www\fit or fat"
c:\wamp\php\bin\php.exe lib\Cake\Console\cake.php bake

please check path to your php executable, it can differ from mine c:\wamp\php\bin\php.exe