php : The term 'php' is not recognized as the name of a cmdlet, function, script file, or operable program in Laravel 1


 

php-The-term-php-is-not-recognized-as-the-name-of-a-cmdlet-function-script-file-or-operable-program-in-Laravel

Solution:

You get this error when you try to run php artisan command like:

php artisan cache:clear 

You need to add PHP.exe folder to your System PATH variables, so PHP can be accessed via terminal.

If you are using WAMP, path of php.exe file should be like given below:

 

 C:\wamp\bin\php\php5.4.3

In XAMPP, it will be like :
 

 

C:\xampp\htdocs\php

PHP.exe file path in Bitnami:

C:\Bitnami\wampstack-7.3.5-0\php

PHP.exe file path in Bitnami

 

 

To add new PATH variable, follow this:

1. Right click on My Computer, select Properties.


2. Select Advanced System Settings.


3. In the System Properties window, click the Environment Variables button.

.In the System Properties window click the Environment Variables button PHP Laravel


4. Select System Variables -> PATH and click Edit.


5. Enter the folder where your PHP.exe is located.

6. Now click on SAVE button to save the changes you made.


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.