2

I'm using RHEL 6.6 and Apache 2.2.15. When I type php -v into terminal I get the right version: 5.6.11 Unfortunately in the web browser phpinfo() returns: 5.3.3

The server only has access to Intranet, so I can't use things like Yum. Despite the fact that there are clearly two different php versions installed, there is only one file libphp5.so and it is linked in the httpd.conf file.

Additionally when I type php -i into the console I get the result: Loaded Configuration file: none

Any idea how to force Apache to use the new version?

1 Answer 1

1

There are two different PHP versions installed. This isn't entirely normal, but it's not abnormal either. The commandline php executable is not the same thing as the php module (mod_php) loaded by Apache -- they are different programs/packages.

Usually you install the same version of each, but if you installed the commandline php much later than the module, it can be a newer version.

Check your installed packages and I bet you have mod_php 5.3.3 and php 5.6.1. If so you need to reinstall mod_php and all of your php modules/extensions.

NOTE: This may potentially bring mod_php up to an even newer version, like 5.6.123 or 5.7.x, whichever is the latest in your repo. To be safe, you should reinstall both at the same time to ensure you get the same version.

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

3 Comments

Actually, in the installed packages I only have php in the older version (5.3.3). I have absolutely no idea why the php -v command in the terminal gives the 5.6.11 result.
It may have been built and installed manually from source, and not with a package. Can you update your question with the output of yum list?
Problem solved. Unfortunately needed to do it the hard way: reinstalling apache and php but it works like a charm now. It turns out the default installation of apache was devoid of apxs and couldn't accept additional modules.

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.