3

I am using xampp, so my php folder is in C:\xampp\php\ and I add in my PATH environment variables the C:\xampp\php\ but when I am running on cmd the php command I am getting the following message:

php is not recognized as an internal or external command.

Any idea what I am missing?

4
  • is php.exe in c:\xammp\php? Whatever folder php.exe is in what you need to add to your $PATH Commented Feb 14, 2014 at 9:06
  • Is you php.exe file in the php folder or in subfolder like php\php5.3.8 Commented Feb 14, 2014 at 9:07
  • php.exe is located on C:\xampp\php . I am using Windows8. Commented Feb 14, 2014 at 9:09
  • 1
    Have you logged in and out again? It might sound stupid, but I remember that for some Windows versions I had to do that in order for PATH to be refreshed. Commented Feb 14, 2014 at 9:43

3 Answers 3

5

When adding an entry to environment variables make sure you leave no spaces between the semicolon and the new path.

I spent a couple of hours going over my steps until I realized that the only difference between other path entries and mine was a single empty space. So i changed it and tried again at the command window (no need to log off and back on) and it worked!

I realize this was asked a while ago but since I found myself looking for a solution i figured this might be helpful to other people too.

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

2 Comments

Thanks. "make sure you leave no spaces between the semicolon and the new path." is such a minute detail, but an important one, and can easily be missed if you're pre-pending new paths.
mine is not that problem but still not getting
3

Here iam sharing some screenshot about adding Environment variables in windows 10 PC

Step 1

Open Control panel and search for environment variable.

Open Control panel and search for environment variable.

Step 2

Select Environment variable.

Select

Step 3

Select path that shown in the below image.

enter image description here

Step 4

click on edit button.

enter image description here

Step 5

Click new button.

enter image description here

Step 6

Add your php file path like given below.

Path may different according to your server.

Then click Ok that's It.

enter image description here

Comments

0

In latest Xampp, path to PHP.exe has changed to this. Means we will have to add this new path in our PATH environment as I mentioned at another Stackoverflow Question. PHP.exe new Path in Xampp

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.