9

Well, I have previously installed PHP 5.3.28 from executable which installed it on my machine, globally with entries in the path variable as:

path ...;C:\php\php53\;...

and another variable as:

PHPRC C:\php\php53

This PHP is configured with Apache 2.2.Running PHP -v from command line results in the version of PHP

enter image description here

After some time I needed to upgrade my versions of PHP (to 5.6) and Apache (to 2.4) and I downloaded them as archived packages and configured them. So now I have two separately configured sets of PHP and Apache. Both of them are working fine, and i also added new PHP 5.6 into my environmental variables but it is not recognizing it.

enter image description here

My environmental variables are:

enter image description here

I also added C:\php\php56\ to path also ahead of red line.But its not working.I require both of these versions of php.exe's.

1 Answer 1

16

Make sure you have php56.exe present in "c:\php\php56\" i.e. "c:\php\php56\php56.exe". You can rename php.exe to php56.exe to test.

Have you also restarted you cmd prompt? Environment variables (the path) do no update inside of an active cmd prompt unless they are edited only within the command prompt.

You can also try calling c:\php\php56\php.exe with a full path to make certain it is working regardless of paths.

1
  • 1
    That is what I was missing. Renaming php.exe as their specific versions solved this issue now I can invoke different versions just by calling their name like php53, php56 and php7.Absolute path was working before i just wanted to use a short name for them. Thanks anyways, it helped.
    – Ali Malik
    Dec 24, 2015 at 15:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.