1

Using phpinfo() in my browser, I see that my PHP version is 5.4.21. However, using "php -v" at a command line prompt, my PHP version reads 4.4.9. I'm not the original PHP installer on this server, so I'm not sure why the mismatch. However, I need the command line version to match (or at least, be close) to my browser version.

Is there a way I can update my command line PHP only? If so, can someone point me to a solution?

I've found similar posts here on SO but none with my particular question and needed solution:

different version php on command line and in apache

PHP Command Line & Browser Returning Different Results

1 Answer 1

1

Use 'where php' (windows) or 'which php -a' (rest of the world) to get the location of the php-binary you are using with the commandline. If the 5.X version shows up as secondary entry, one may consider deleting 4.x (after making sure, you have a backup around and ini-files are not shared between both versions). If it does not, modify your PATH to include the 5.5 location prior to the 4.X version (or delete/upgrade later)

This implies that you use php direclty without specifing a location.

If one of the versions is installed using the packet-manager of your choice, go check out their documentation before performing any steps.

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.