I got the following error when I run a command with php
C:\xampp\htdocs>php
'php' is not recognized as an internal or external command,
operable program or batch file.
I don't get any error when I run the command with php
in following path:
C:\xampp\php>php //do not got error here
Why I get this error?
'php' is not recognized as an internal or external command, operable program or batch file.
Add C:\xampp\php
to your PATH
environment variable.
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.