0

I'm trying to setup baking with Cakephp 3.4 on a Windows 10 machine using wamp. So first let me start with the paths that I'm using.

Path to Wamp is: C:\wamp

Path to PHP is: C:\wamp\bin\php\php5.6.25

Path to cakephp project fold is: C:\wamp\www

Path to current cakephp project is: C:\wamp\www\BrandInnovation

Path to cake, cake.bat and cake.php files is: C:\wamp\www\BrandInnovation\bin

So I remember in 2.x you had to set Windows Environment Variables to have it work. It was something like c:\wamp\bin\php\php5.6.25\;c:\wamp\www\cake\console\ in the advanced system settings in windows. My problem is that in Cakephp 3.x I dont see the \cake\Console anymore in any of the sites files.

If I open the Command Prompt in windows and navigate to C:\wamp\www\BrandInnovation\bin and execute the cake.bat file I get

C:\wamp\www\BrandInnovation\bin>cake.bat 'php' is not recognized as an internal or external command, operable program or batch file.

Any and all help would be great and thanks.

user3137609
  • 119
  • 5
  • From default installation, I am able to run `bin\cake bake ...` and it would work. If you `cd C:\wamp\www\BrandInnovation` and run your command it should work. due to your error `'php' is not recognized` I would say this is a PHP installation issue, not a CakePHP issue. –  Jun 06 '17 at 16:34
  • I dont think that is the case as I can see the sites locally in my browser, if PHP was not working then the sites would not work or would wamp. Pretty sure it a path or windows environment variable problem. – user3137609 Jun 06 '17 at 16:40
  • I'm not saying you don't have php installed, I think the environment path for PHP is not working. In your cmd type 'php -v' –  Jun 06 '17 at 16:44
  • 3
    WAMPServer does not and SHOULD NOT put the PHP folder on the Windows PATH envronment variable. It would TOTALLY DESTROY the ability of WAMPServer to easily switch versions of PHP – RiggsFolly Jun 06 '17 at 16:44
  • 2
    See this answer https://stackoverflow.com/questions/15597067/how-to-run-php-from-windows-command-line/16289254#16289254 – RiggsFolly Jun 06 '17 at 16:44
  • Note: PHP used by Apache is not quite the same thing as PHP CLI used from the command line. – RiggsFolly Jun 06 '17 at 16:50
  • Thanks RiggsFolly, I was able to make a phppath.cmd file with the code below PATH=%PATH%;c:\wamp\bin\php\php5.x.y php -v I then navigated in the cmd file in the command prompt and ran it, then I navigated to C:\wamp\www\BrandInnovation\bin and rand "cake bake" and it work! – user3137609 Jun 06 '17 at 16:58

0 Answers0