CentOS – updating PHP via yum doesn’t change the version apache uses

apache-2.2centosPHPyum

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?

Best Answer

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.