简体   繁体   中英

I can't create bundle in symfony2

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 PATH will be something like this:

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

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 PATH variable to D:\\php\\wamp\\bin\\php\\php5.3.10\\php.exe rather than D:\\php\\wamp\\bin\\php\\php5.3.10 . Fixing this solved the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM