I have Windows 7 and WAMP localhost on drive D:. I installed Symfony2 correctly. When I open http://127.0.0.1/Symfony/web/config.php I can see the Welcome! message. But in the tutorial “Creating Pages in Symfony2” when I want to create a bundle by this command:
php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
This message appears:
"php is not recognized as an internal or external command oprable program or batch file"
I don’t know what I should do.
You are receiving that error because PHP is not in your system
PATH. Check out this quick tutorial on installing PHP on Windows. Take note of Step 4 which is the installation step that should fix your problem.Since you’re using WampServer, the path you have to add to
PATHwill be something like this:This is only an example, change the path to the actual path to PHP on your system. If the path has spaces in it (like
Program Files (x86)does) it is helpful to always surround it with quotes (“).Update: I ended up getting on a screen sharing program with @reza and discovered he had accidentally set his
PATHvariable toD:\php\wamp\bin\php\php5.3.10\php.exerather thanD:\php\wamp\bin\php\php5.3.10. Fixing this solved the problem.