symfony1 – i think my path is correct but still gives the same error ‘php.exe’ not recognized – Education Career Blog

my symfony sandbox is inside the htdocs of my xampp folder which is inside the program files in c drive
i.e.

c:\program files\xammp\htdocs\sf_sandbox\

but when i try to run the command symfony -v it gives the error

‘php.exe’ is not recognized as an internal or external command

can somebody help me? what am i doing wrong?…

,

In this case you need to include the php folder or directory path to the all the global paths available in command line interface.

right click on the My Computer icon of the windows and you will be able to see the screen as given below

Click on the Advanced Tab of this window and then click on the Environment Variables button of the window

In the new window select TMP variable and then select Path variable and click on edit button.

At the end of the variable value field add the path of the directory (containing the php.exe sometimes its not what is given here. i.e. i had one situation where it was E:\wamp\bin\php\php5.2.8) for php (here it is ;C:\wamp\php) also put a semcolon (;) to seperate the path with the other existing paths.

Now one by one click ok for each window opened and restart your computer and the task is complete.

To check it just type php -v and press Enter.

,

What happens when you try to execute php from command line?

Have you tried adding path to php.exe to PATH environmental variable?

,

You may wish to try to adust the path to have c:\progra~1\xammp\htdocs\sf_sandbox in it. The short name for any long path in DOS has been the downfall of many applications and they must be handled properly. If you open a dos window and issue:

cd \
dir /x

you will get a list of short names in 8.3 format.

Leave a Comment