DrR

Cake, Bake is not recognized as an internal or external command

I wanted to start using CakePHP framework but I’ve encountered an error when trying to bake something:

'cake' or 'bake' is not recognized as an internal or external command

So I was wondering how to fix it. When I searched over the internet I found a lot of articles which weren’t helpful at all. That’s why I want to share a quick fix for everyone.

Here is the fix:

  1. Right click on My Computer
  2. Select Properties
  3. Go to Advance system settings
  4. Click on Environment Variables
  5. Go to System variables
  6. Select PATH and edit or add this:
C:\xampp\htdocs\YOURAPPNAME\bin\;
C:\wamp\www\YOURAPPNAME\bin\

After this restart your PC and you will see that now it’s working.

Also I’ve notice that some have written the command as bin\cake bake … but for me it’s working as cake bake … without bin\. For a notice I’m using Windows 10 Pro.

Hopefully it will spare you some time fixing it and if you like it shares are welcome!