How do you fix php is not recognized as an internal or external command?

PHP is not recognized as an internal or external command

Have you ever faced this type of error while running PHP command from command prompt? Some PHP files like cron job and socket server, we need to run them from command prompt. Normally this type of error only produce when we use php command in command prompt without setting up PHP path in system environment variable. Thus, it will throw error like PHP is not recognized as an internal or external command. So in this post, i will show you how to setup PHP path in system environment variable and get rid of this error.

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

How do you fix php is not recognized as an internal or external command?

Before continue, I assume that you have already installed PHP in your windows system. If you haven’t then you can checkout our tutorial on how to install PHP in windows using XAMPP.

Now first of all find out PHP path from your system. For XAMPP server, your installed PHP path is (Drive Name):/xampp/php [Drive name should be your xampp installed drive]. If you have installed other PHP environment like WAMP or LAMP then, please check PHP path on google for them.

I have installed XAMPP in E: drive. So my PHP path is E:\xampp\php.

Now open control panel and search for “System” and click on it.

How do you fix php is not recognized as an internal or external command?

Now click on “Advanced System Settings“.

How do you fix php is not recognized as an internal or external command?

Now click on “Environment Variables“.

How do you fix php is not recognized as an internal or external command?

Now select Path in system variables section and click on Edit button.

How do you fix php is not recognized as an internal or external command?

Now add PHP path (E:\xampp\php) after (;) semicolon at last as shown below image and click Ok.

How do you fix php is not recognized as an internal or external command?

Now lets check if error is fixed or not. If you have already opened command prompt, please close and reopen it. Otherwise changes will not reflect on it. Set XAMPP path (E:/xampp) in it.

Now run php -v command to check php version. If everything works fine than you will see version of PHP.

How do you fix php is not recognized as an internal or external command?

Congratulation you have done it.

I hope that this tutorial helps you. If you have any query regarding this tutorial then please share with me in the comments. I will help you to short it out. Thank you for reading this article.

How do you fix command is not recognized as an internal or external command?

We have listed fixes for both versions of the error, so follow the relevant one to your case..
Verify if the Program Is Installed. ... .
Use the Full File Path to Execute the Command. ... .
Use the Full File Path Within Double Quotes. ... .
Add the File Path to the Windows Environment Variables. ... .
Move Files to System32 Folder..

How do you fix is not recognized as an internal or external command operable program or batch file?

Use The Full Path To The Executable File The “is not recognized as an internal command” error usually occurs because the computer can't find the executable that you're asking it to launch. However, you can provide it with the full path to your executable file and it should then be able to run it without any issues.

Why am I getting Java is not recognized as an internal or external command?

The Java is not recognized as an internal or external command in Command Prompt error occurs if the environment variables are not configured correctly. By adding the correct path to an environment variable, you can resolve the issue. If the error persists, try installing the compatible Java version.

Is not Recognised as an internal or external command?

If you're coming up against app or command 'is not recognized as an internal or external command' errors when trying to do something in the command line, update an app or install something new, you're not alone. It happens when Windows environmental variables are changed which prevent the command being run.