Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP is not recognized as an internal or external command in command prompt

Tags:

php

cmd

exe

People also ask

How do I know if PHP is installed on Windows?

1. Type the following command, replacing [location] with the path to your PHP installation. 2. Typing php -v now shows the PHP version installed on your Windows system.

Why it is showing it is not recognized as internal or external command?

The “not recognized as internal command” error usually occurs because the computer cannot find the executable file it is trying to start. However, you can provide the full path to your executable and then it should run without any problem. Launch a Command Prompt window on your PC.


Add C:\xampp\php to your PATH environment variable.(My Computer->properties -> Advanced system setting-> Environment Variables->edit path)

Then close your command prompt and restart again.

Note: It's very important to close your command prompt and restart again otherwise changes will not be reflected.


You need to Go to My Computer->properties -> Advanced system setting

Now click on Environment Variables..

enter image description here

Add ;C:\xampp\php in path variable value

enter image description here

Now restart command prompt DONE!

Note: Make sure you run CMD via run as administrator


You just need to a add the path of your PHP file. In case you are using wamp or have not installed it on the C drive.

The picture shows how to find the path


Set "C:\xampp\php" in your PATH Environment Variable. Then restart CMD prompt.


Is your path correctly configured?

In Windows, you can do that as described here:

http://www.computerhope.com/issues/ch000549.htm