I cannot create a package in symfony2

I have Windows 7 and WAMP localhost on disk D:

. I have installed Symfony2 correctly. When I open

, I see a greeting! message. But in the tutorial "Creating Pages in Symfony2", when I want to create a package with this command:

php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml


This message will appear:

"php is not recognized as an internal or external command oprable program or batch file"


I do not know what should I do.


source to share

1 answer

You are getting this error because PHP is not on your system PATH

. Check out this quick tutorial on how to install PHP on Windows. Pay attention to Step 4 , which is the installation step that should fix your problem.

Since you are using WampServer, the path you should add to PATH

will look something like this:

"C:\Program Files (x86)\Wamp\bin\php5.3.10"


This is just an example, change the path to the actual PHP path on your system. If there are spaces in the path (for example, Program Files (x86)

), it is useful to always surround it with quotes (").

Update: . I got into a screen sharing program using @reza and found that he had accidentally set his variable PATH

to D:\php\wamp\bin\php\php5.3.10\php.exe

, not D:\php\wamp\bin\php\php5.3.10

. Fixed this solution to the problem.



All Articles