• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
8 views

Problem:

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.

by (140 points)  
edited by

1 Answer

0 votes

Solution:

This kind of issue comes when you not install php properly

make sure you install php engine properly and also check its Environment Variables 

You need to go to My Computer->properties -> Advanced system setting and click on Environment Variables

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

note: you this path you can set according to your system where you install your php in case of using xampp you follow above path

Now restart command prompt DONE! Note: Make sure you run CMD via run as administrator

by (140 points)  
edited by
...