Symfony CreateProccess Error

十年热恋 提交于 2019-12-25 01:35:14

问题


I started using Symfony today and I wanted to use the CLI. So I have installed PHPstorm. Followed all instructions. Added an up to date php 5.4

Now when I try to run:

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

Cannot run program "$" (in directory "E:\wamp\www\Symfony"): CreateProcess error=2, The system cannot find the specified map

Any ideas on how to fix this?

Edit

> php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
Cannot run program "php" (in directory "E:\wamp\www\Symfony"): CreateProcess error=2, Het systeem kan het opgegeven bestand niet vinden

> php.exe app/console generate:bundle --namespace=Acme/HelloBundle --format=yml
Cannot run program "php.exe" (in directory "E:\wamp\www\Symfony"): CreateProcess error=2, Het systeem kan het opgegeven bestand niet vinden

I tried the answers, but it doesn't seem to change anything! Is this a bigger thing?

EDIT 2 SOLVED SO FAR

> c:\full\path\to\your\php.exe app/console generate:bundle --namespace=Acme/HelloBundle --format=yml

That piece saved my life, thanks!


回答1:


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

As there $ normally means your terminal invitation. And you try to run command '$' with the rest of string being parameters.

> c:\full\path\to\your\php.exe app/console generate:bundle --namespace=Acme/HelloBundle --format=yml

OR add path to php to %PATH%




回答2:


$ is just a markup showing that this is run in console. If you are running this on Windows, you should do it like this:

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

To make php work in CLI, you need to add the path to it's binary (where php.exe resides) to PATH.



来源:https://stackoverflow.com/questions/13869995/symfony-createproccess-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!