I got the following error when I run a command with php
C:xampphtdocs>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:xamppphp>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:xamppphp
to yourPATH
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.