php : The term 'php' is not recognized as the name of a cmdlet, function, script file, or operable program
Try adding your PHP.exe
's folder to your System PATH variables
, so PHP can be accessed via terminal.
For example; C:\wamp\bin\php\php5.4.3
To add new PATH variable
, follow this:
- Right click on
My Computer
, selectProperties
- Select
Advanced System Settings
- In the
System Properties window
click theEnvironment Variables button
. - Select
System Variables -> PATH
and click Edit. - Enter the folder where your
PHP.exe
is located.
If you did this correctly, restart your terminal and type php --version
to check if it works.
Note: Don't forget to seperate paths by using ;
seperator.
it's quite simple man, maybe you forgot to type "php" first before you type your php name, for example is our php file name is youcan.php . If you wanna open it on your cmd/powershell you gotta type "php youcan.php" thats my own experience, may it can help you brother.