3

I have a problem in accessing the php command using command line. I also created a PATH in my environment variables.

The PATH is like this

C:\wamp\bin\php\php5.5.12

Now the console output is this

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

I also restarted the PC and the command console still same effect. I also created a batch for this still same effect too.

SET PATH=%PATH%;C:\wamp\bin\php\php5.5.12

Is there some configuration other than this? I am using wampserver.

12
  • 1
    Check where the php.exe is, i guess is in bin directory so your path need to be something like this SET PATH=%PATH%;C:\wamp\bin\php\php5.5.12\bin Commented May 20, 2014 at 7:00
  • It's not in he bin folder. :( Commented May 20, 2014 at 7:14
  • did you check if that path is actually in system path variable (system->environment variables)? i think setting path with your command works only while cmd is open. Commented May 20, 2014 at 7:15
  • I saved it in the environment variables. Commented May 20, 2014 at 7:16
  • and it is in when you type echo %PATH% ? Commented May 20, 2014 at 7:17

1 Answer 1

3

If you run echo %PATH% and it does not include the path to WAMP, then the problem is simply that you haven't set it properly in your environmental variables.

The setting is located here: https://i.sstatic.net/xcHT9.png

Edit the System Variables "Path" field and prepend your path to WAMP (obviously make sure you have the exact path to the folder where php.exe is located). Then click OK until all the settings dialogs are closed.

Once you change the path, you will need to close your CMD window and open a new one. The path changes don't take effect on any open CMD windows.

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.