How to set the env variable for PHP?
You need to put the directory that has php.exe
in you WAMP
installation into your PATH
. It is usually something like C:\wamp\xampp\php
For windows: Go to your "system properties" please.then follow as bellow.
Advanced system settings(from left sidebar)->Environment variables(very last option)->path(from lower box/system variables called as I know)->edit
then concatenate the "php" location you have in your pc (usually it is where your xampp is installed say c:/xampp/php)
N.B : Please never forget to set semicolon (;) between your recent concatenated path and the existed path in your "Path"
Something like C:\Program Files\Git\usr\bin;C:\xampp\php
Hope this will help.Happy coding. :) :)
Follow this for Windows operating system with WAMP installed.
System > Advanced System Settings > Environment Variables
Click new
Variable name : path
Variable value : c:\wamp\bin\php\php5.3.13\
Click ok
You need to add the PHP directory to your path. On the command line (e.g. in a batch file), it would look like this:
SET PATH=%PATH%;C:\your\wamp\path\php
if in doubt, it's the directory containing the php.exe
.
You can also pre-set the path in Windows' control panel. See here on how to do this in Windows 7 for example.
Be aware that if you call the PHP executable from an arbitrary directory, that directory will be the working directory. You may need to adjust your scripts so they use the proper directories for their file operations (if there are any).