Search code examples
phpwindowswindows-console

How to tell Git I'm upgrading php?


I've just upgraded PHP to the latest version. When I get back to Git, to my command shell, if I execute any PHP function, then I get this error :

sh.exe": php: command not found

I know I have to tell git bash where my new PHP path is, but I don't know how to do so and I can't find anything on Google about that.

EDIT :

I made a confusion you're right : I meant Git BASH by git. Thanks :)

SO here is the function I tried to call when I was dealing with symfony in the root foler of my app :

php app/console dump-sql

then Git BASH sent me the error above.


Solution

  • If you are windows, then following up on halfer's comment, it is required that you add the new /bin/ directory of the php folder to your PATH.

    To do this: 1. Open start menu
    2. Right click my computer->properties
    3. Click advanced tab -> Environment variables
    4. Scroll down in the second listbox for a entry called PATH
    5. add this to the end ;C:/%PHP_LOCATION%/bin
    where %PHP_LOCATION% is the place that you installed PHP to.