Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

The server was running PHP 5.1.6, so we have updated it through running yum update. This updated PHP to 5.3.3 and running php -v shows this version. However, after restarting the apache, phpinfo() reports that the PHP version is still 5.1.6.

Are there somehow two versions of PHP on the server? What is going on?

share|improve this question
2  
Where did you get this version of PHP 5.3.3? Because looking in the master mirrors, CentOS Plus, and EPEL, I don't see anything but 5.1.6. Perhaps whomever is providing this package has instructions on how to use it, what other packages need to be installed, etc...? FYI: Looks like CentOS 6 will have PHP 5.3.3, but until then I'd probably use Ubuntu LTS instead. –  Sean Reifschneider Dec 1 '10 at 10:43
    
Note that RHEL 5.6 (and upcoming CentOS 5.6) includes PHP 5.3.3 packages (as php53-*). See rhn.redhat.com/errata/RHEA-2011-0069.html –  mattdm Jan 24 '11 at 20:24
add comment

4 Answers

You also need to upgrade the Apache httpd module for PHP. Usually there are three packages for PHP: one for CLI, one for FastCGI and CGI, and one for mod_php.

share|improve this answer
add comment

did you restart apache?

service httpd restart
share|improve this answer
add comment

Check which libphp5.so is loaded into your Apache through the LoadModule directive. Then see if this file is part of your php5-package (not sure what's it's name for centos): rpm -qf <path/to/libphp5.so>. If the file does not belong to any package then you should point you Apache configuration to the libphp5.so shipped through the rpm package.

share|improve this answer
add comment

I personally use the IUS project for my CentOS packages. PHP and MySQL is kept bang up to date.

http://iuscommunity.org/

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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