Sadikhasan Sadikhasan - 1 year ago 76
PHP Question

php is not recognized as an internal or external command in command prompt

I got following error when I run command with

php


C:\xampp\htdocs>php
'php' is not recognized as an internal or external command,
operable program or batch file.


I do not got any error when I run command with
php
in following path

C:\xampp\php>php //do not got error here


Why I got error like

'php' is not recognized as an internal or external command, operable program or batch file.

Answer Source

Add C:\xampp\php to your PATH Environment Variable. Then Close The Command Prompt And Restart Again. Its important because if you didn't restart you command prompt then changes will not reflect.Thanks.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download