1

I add to global variable PATH the path of the folder that contain php.exe on a Windows machine (Windows U7 x64). But when I type in the console:

php -v

I'm getting:

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

And if I type:

php.exe -v

It works:

PHP 5.5.10 (cli) (built: Mar May 2014 14:49:07) Copyright (c) 1997-2014 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies

1 Answer 1

1

The environment variable PATH contains the list of folders to search for an application separated by semi-colons.

The environment variable PATHEXT contains also separated by semi-colons the file extensions valid for applications on search for an application if file name of application is specified on command line or in a batch file without file extension.

It looks like on your computer PATHEXT is not correct defined. Standard on Windows is:

PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH

Entering in a command prompt window set path displays PATH and PATHEXT.

See also the remarks section on Microsoft documentation of command start.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.