You linked the 2.X documentation, but I’m on 3.X. On 3.X, I don’t believe you need to add the executable path to the PATH system variable. Instead you cd into your app folder, and run bin/cake.
Nevertheless, I added X:\xampp\htdocs\tools\bin to my System Variable called PATH, to no avail. Still the same error.
I can run shells fine without issues. I made a shell called ToolsShell. When I run bin/cake tools everything works fine. It’s only when I try to run a command, I have issues.
On the terminal, I’ve traversed using cd into my project folder. I run the command bin/cake Hello.
According to the documentation that should output Hello World. But I get the error shown in the top post.
Edit:
The reason I brought up the ToolsShell example, was to show that running Shells work perfectly according to documentation, but I understand Shell are deprecated.
I’m not sure I ever found out what the issue was, but I’m having no trouble creating commands as of now. I’ve kept upgrading CakePHP as new versions are released, so that might have solved the issue for me.
I’m currently using 3.8.0 on one app, and 3.7.2 on another, where adding commands works like a charm. Maybe this was fixed in the 3.7 release. What version are you using?
there is also webroot/index.php file that will need update if you didnt have Application.php and note that in requirements.php there is note You can empty out this file, if you are certain that you match all requirements.
I have been having the same problem trying to follow the documentation in the cookbook - I was seeing the text of the php file being echoed to the console, then the ‘command not found’ error.
It turns out I was missing a “<?php” at the top of the file…
I thought I’d write this down in case anyone else hits the same problem.