php is not recognized as an internal or external command operable program or batch file
» is not recognized as an internal or external command, operable program or batch file
Whenever I try and run mycommand.exe from my windows cmd.exe terminal, I get this error:
»mycommand.exe’ is not recognized as an internal or external command, operable program or batch file’
Then
I also experienced a similar error when I tried to run C:\Program Files\My-App\Mobile.exe
»C:\Program’ is not recognized as an internal or external command, operable program or batch file’
2 Answers 2
This is a very common question seen on Stackoverflow.
The important part here is not the command displayed in the error, but what the actual error tells you instead.
a Quick breakdown on why this error is received.
cmd.exe Being a terminal window relies on input and system Environment variables, in order to perform what you request it to do. it does NOT know the location of everything and it also does not know when to distinguish between commands or executable names which are separated by whitespace like space and tab or commands with whitespace as switch variables.
When Actual Command/executable fails
First we make sure, is the executable actually installed? If yes, continue with the rest, if not, install it first.
If you have any executable which you are attempting to run from cmd.exe then you need to tell cmd.exe where this file is located. There are 2 ways of doing this.
specify the full path to the file.
Add the location of the file to your environment Variables.
Goto:
——> Control Panel-> System-> Advanced System Settings->Environment Variables
In the System Variables Window, locate path and select edit
Now simply add your path to the end of the string, seperated by a semicolon ; as:
Save the changes and exit. You need to make sure that ANY cmd.exe windows you had open are then closed and re-opened to allow it to re-import the environment variables. Now you should be able to run mycommand.exe from any path, within cmd.exe as the environment is aware of the path to it.
When C:\Program or Similar fails
‘php.exe’ is not recognized as an internal or external command, operable program or batch file
‘php.exe’ is not recognized as an internal or external command, operable program or batch file.
Why does that error occur even though I’ve added PHP to my environment variables?
My environment variable PATH is shown below:
I’m using Windows 7.
10 Answers 10
The PATH environment variable must contain paths only, not file names.
I think you need to change it to A:\xampp\php\ and just leave it there, then it will search the directory for the file, also: have you tried calling just php instead of php.exe and check that the directory is correct.
View above screen shot for setup enviroment variable in window 7
Note:- After setup enviroment variable please restart you computer then its will work fine
Also, you need to specify the folder, not the exe file itself.
Close your command prompt if open
*(Proceed to 7. to confirm if php is installed)
Set PHP as environment variable from System as below to run it from CMD
If you have installed WAMP server, then your path can vary. For example, I installed WAMP and the path to my php.exe turned out to be:
To make it work, I entered the following path in the PATH variable of the System Variables:
Once done, I restarted command prompt and everything worked fine.
PHP is not recognized as an internal or external command in command prompt
I got the following error when I run a command with php
I don’t get any error when I run the command with php in following path:
Why I get this error?
‘php’ is not recognized as an internal or external command, operable program or batch file.
11 Answers 11
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.
Now click on Environment Variables..
Add ;C:\xampp\php in path variable value
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.
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:
Very important note: restart command prompt
I must update PATH like these HERE! all my software i usually used
If you are using PhpStorm as IDE, after updating the path variable you need to restart PhpStorm so that it takes effect.
Restarting terminal window was not enough for me. (PhpStorm 2020.3.2)
I faced this issue even with a properly set up windows environment variable. I just needed to close and restart the terminal to solve it.
‘react-native’ is not recognized as an internal or external command, operable program or batch file
I recently started with react-native. I install it using the tutorial on the facebook site and everything works well for a day or two, until this message comes up:
Nothing works except uninstalling everything and starting all over again. The environments are ok and work (npm, choco, etc.). I have also tried removing and adding react-native to environment variables, restarting, running cmd in administrator mode, but nothing so far. I should add that I use windows 10 64-bit.
23 Answers 23
I had the same issue and tried the following but didnt work 1) Adding npm path to my Environment variables; both system and user 2) Re install npm and react-native-cli
Both didn’t work for me, im using Windows 10;
Solution that worked for me is to install react-native-cli globally You can install it globally by using the below command:
Hope that helps you! Cheers 🙂
You can simply use npx react-native it will work
your system or user environment PATH variable was edited, you can uninstall NodeJs and install it again or add below path to end of PATH variable into user variables the restart the Windows :
You need to setup the npm path in your environment variables. Please look at the images down below
But dont forget to restart command promprt
I get the same error right off the bat on Windows 10 running in cmd window in adminstrator mode, however there is also a bash shell version of react-native that worked for me in a git bash window.
I had to add the %APPDATA%\npm folder to my PATH on Windows 10. Global modules are installed there.
If uninstalling and installing again the npm did not work on you, try adding %APPDATA%\npm to path (Environment variables) then quick reboot/restart. System Reboot should really be part of the process. This worked on my end.
Install :
Uninstall :
Now, as a regular user without admin rights:
I have Windows 7 and tried to use the ‘make’ command but ‘make’ is not recognized as an internal or external command.
‘make’ is not recognized as an internal or external command,operable program or batch file.
‘mingw32-make’ is not recognized as an internal or external command,operable program or batch file.
What shall I do next in order to fix this problem?
12 Answers 12
Your problem is most likely that the shell does not know where to find your make program. If you want to use it from «anywhere», then you must do this, or else you will need to add the full path each time you want to call it, which is quite cumbersome. For instance:
This is to be taken as an example, it used to look like something like this on XP, I can’t say on W7. But gnuwin32 used to provide useful «linux-world» packages for Windows. Check details on your provider for make.
In Windows10, I solved this issue by adding «C:\MinGW\bin» to Path then called it using MinGW32-make not make
This is an old question, but none of the answers here provide enough context for a beginner to choose which one to pick.
make is a traditional Unix utility which reads a Makefile to decide what programs to run to reach a particular goal. Typically, that goal is to build a piece of software from a set of source files and libraries; but make is general enough to be used for various other tasks, too, like assembling a PDF from a collection of TeX source files, or retrieving the newest versions of each of a list of web pages.
Notice that the indentation needs to consist of a literal tab character. This is a common beginner mistake.
Common Versions of make
So Which Do I Need?
Well, it really depends on what you are hoping to accomplish.
If the software you are hoping to build has a vcproj file or similar, you probably want to use that instead, and not try to use make at all.
In the general case, MinGW make is a Windows port of GNU make for Windows, It should generally cope with any Makefile you throw at it.
If you know the software was written to use nmake and you already have it installed, or it is easy for you to obtain, maybe go with that.
You should understand that if the software was not written for, or explicitly ported to, Windows, it is unlikely to compile without significant modifications. In this scenario, getting make to run is the least of your problems, and you will need a good understanding of the differences between the original platform and Windows to have a chance of pulling it off yourself.