Imnotapotato
Imnotapotato

Reputation: 5808

WAMP: "'php' is not recognized as an internal or external command operable program or batch file" although adding PATH

when I run PHP in CMD I get this error msg:

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

the path was already added and I followed this tutorial:

http://perials.com/install-composer-on-windows-and-wamp/

C:\Program Files (x86)\Lenovo\FusionEngine;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Lenovo\Motion Control\;C:\Program Files (x86)\Common Files\lenovo\easyplussdk\bin;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\; C:\wamp\bin\php\php5.5.12; C:\wamp\www; C:\wamp\www\AKP\examples\AdWords\Auth;C:\Program Files (x86)\Skype\Phone\;C:\ProgramData\ComposerSetup\bin

enter image description here

I created the file suggested in this post: Installing Composer globally for laravel usage?

and nothing.

Most of the posts I ran into solved the problem with adding the path - which doesn't solve mine.

I am currently using WAMP on Windows 10.

What can be the problem?

Upvotes: 7

Views: 24756

Answers (3)

patilganesh1010
patilganesh1010

Reputation: 11

if you are working with xampp then search for environment variable > click environment variable > system variable > PATH > edit > new > copy paste the location of xampp for windows C:\xampp\php then you can check php version with command php -v

Upvotes: 1

Rashi Goyal
Rashi Goyal

Reputation: 941

PHP is not included in your PATH. Right click you're My Computer, then Properties, Advanced System Settings, Environment Variables and then find PATH variable, add your PHP installation dir there. Close your previously launched CMDs, re-launch it, it should work now.

Upvotes: 8

Álvaro González
Álvaro González

Reputation: 146460

I don't really understand what you mean with Windows 10 displaying %20 but error message says you don't have any php program in PATH and that's the exact problem. Path directories are not case sensitive (that's how Windows is designed to work) but spaces do matter:

C:\>PATH C:\WINDOWS;C:\PHP

C:\>php -v
PHP 5.6.15 (cli) (built: Oct 29 2015 12:40:36)
Copyright (c) 1997-2015 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2015 Zend Technologies

C:\>PATH C:\WINDOWS; C:\PHP

C:\>php -v
"php" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

C:\>PATH C:\PHP ;C:\WINDOWS

C:\>php -v
"php" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

Even if Windows 10 had changed PATH handling to fix some common errors (something I can't test right now) I think it's simpler to just type the right path verbatim.

Upvotes: 7

Related Questions