Stefan Stefan - 7 months ago 21
PHP Question

Windows environment variables not recognized

I'm trying to set some windows environment variables. But for some reason after saving my variable it still can't be used in cmd.

For example PHP:
php environment variable

The error I keep getting:

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

I used the Browse File... button to select the
application just to make sure I didn't make any typos. Also I tried to change the value to
this didn't work either.

Restarting windows didn't help. Also typing just
works fine.

Does anyone have an idea what I'm doing wrong here?


If you want to use php without specifying its full path you should modify %PATH% (or create a new %PATH% user variable):


%PATH% tells the operating system which directories to search when you try to run things. Make sure to log out and back in after changing this variable.

See also