PHP version updated to php-5.4.37-1.el6.remi but server still using older version (CentOS release 6.6 (Final))

Claudia asked:

i’m having problems to update php on server CentOS release 6.6 (Final), from php-5.3.25 to my required version php-5.4.37. I downloaded and enabled remi repository an then installed the mentioned php version with all its dependencies, i have already restarted apache, and even reboot the system, but when i call command

$ php -v

it still says older version:

PHP 5.3.25 (cli) (built: May 31 2013 23:20:28) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

I have even retry to install my desidred verision of php but looks like it’s already installed on the system:

$ yum install php-5.4.37-1.el6.remi

Loaded plugins: fastestmirror, replace
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                                                                                                    |  14 kB     00:00     
 * epel: mirrors.kernel.org
 * remi: mirrors.mediatemple.net
 * webtatic: us-east.repo.webtatic.com    
Package php-5.4.37-1.el6.remi.x86_64 already installed and latest version
Nothing to do

Do i have to change the production version somewhere else on my apache configuration, thanks a lot in anticipate.

Commands gives

$ which php

/usr/local/bin/php

$ rpm -qa | grep php

cpanel-php54-Date-Holidays-Netherlands-0.1.3-1.cp1142.noarch
cpanel-php54-Date-Holidays-Spain-0.1.3-1.cp1142.noarch
php54-php-xml-5.4.37-1.el6.remi.x86_64
cpanel-php54-PEAR-Command-Packaging-0.3.0-1.cp1142.noarch
cpanel-php54-Console-Table-1.1.5-1.cp1142.noarch
cpanel-php54-Net-Socket-1.0.14-1.cp1142.noarch
cpanel-php54-Date-Holidays-Finland-0.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Ireland-0.1.3-1.cp1142.noarch
cpanel-php54-File-1.4.1-1.cp1142.noarch
cpanel-php54-Console-Color-1.0.3-1.cp1142.noarch
cpanel-php54-5.4.23-4.cp1142.x86_64
cpanel-php54-Mail-Mime-1.8.3-1.cp1142.noarch
cpanel-php54-Date-Holidays-Croatia-0.1.1-1.cp1142.noarch
php-5.4.37-1.el6.remi.x86_64
cpanel-php54-Net-DNS2-1.3.1-1.cp1142.noarch
cpanel-php54-HTML-Template-IT-1.3.0-2.cp1142.noarch
cpanel-php54-Date-Holidays-Serbia-0.1.0-1.cp1142.noarch
cpanel-php54-Date-Holidays-Czech-0.1.0-1.cp1142.noarch
cpanel-php54-Net-Sieve-1.3.2-1.cp1142.noarch
cpanel-php54-Auth-SASL-1.0.6-1.cp1142.noarch
cpanel-php54-XML-Parser-1.3.4-1.cp1142.noarch
cpanel-php54-Date-Holidays-UNO-0.1.3-1.cp1142.noarch
php54-php-common-5.4.37-1.el6.remi.x86_64
cpanel-php54-Date-Holidays-Venezuela-0.1.1-1.cp1142.noarch
cpanel-php54-zendopt-6.0.0-1.cp1142.x86_64
cpanel-php54-Net-URL-1.0.15-1.cp1142.noarch
cpanel-php54-Date-Holidays-SanMarino-0.1.1-1.cp1142.noarch
cpanel-php54-Date-Holidays-Germany-0.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Russia-0.1.0-1.cp1142.noarch
cpanel-php54-Date-Holidays-EnglandWales-0.1.5-1.cp1142.noarch
cpanel-php54-File-Fstab-2.0.3-1.cp1142.noarch
cpanel-php54-Text-Figlet-1.0.2-1.cp1142.noarch
cpanel-php54-HTTP-1.4.1-2.cp1142.noarch
cpanel-php54-Date-Holidays-0.21.8-1.cp1142.noarch
cpanel-php54-Date-Holidays-USA-0.1.1-1.cp1142.noarch
cpanel-php54-Date-Holidays-Slovenia-0.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Japan-0.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Turkey-0.1.1-1.cp1142.noarch
php54-2.0-2.el6.remi.x86_64
cpanel-php54-sourceguardian-8.3-1.cp1142.x86_64
cpanel-php54-XML-RPC-1.5.5-1.cp1142.noarch
cpanel-php54-DB-1.7.14-1.cp1142.noarch
cpanel-php54-Net-SMTP-1.6.2-1.cp1142.noarch
cpanel-php54-Mail-1.2.0-1.cp1142.noarch
cpanel-php54-Date-Holidays-Denmark-0.1.3-1.cp1142.noarch
cpanel-php54-Date-Holidays-Australia-0.2.1-1.cp1142.noarch
cpanel-php54-Date-Holidays-Ukraine-0.1.2-1.cp1142.noarch
php54-php-cli-5.4.37-1.el6.remi.x86_64
cpanel-php54-Date-Holidays-Romania-0.1.2-1.cp1142.noarch
php-cli-5.4.37-1.el6.remi.x86_64
cpanel-php54-Cache-1.5.6-1.cp1142.noarch
cpanel-php54-XML-SVG-1.1.0-1.cp1142.noarch
cpanel-php54-Net-UserAgent-Detect-2.5.2-1.cp1142.noarch
cpanel-php54-Date-1.4.7-2.cp1142.noarch
cpanel-php54-Date-Holidays-Sweden-0.1.3-1.cp1142.noarch
cpanel-php54-Date-Holidays-Portugal-0.1.0-1.cp1142.noarch
cpanel-php54-MDB2-2.4.1-2.cp1142.noarch
cpanel-php54-SOAP-0.13.0-1.cp1142.noarch
cpanel-php54-Date-Holidays-Italy-0.1.1-1.cp1142.noarch
php54-runtime-2.0-2.el6.remi.x86_64
cpanel-php54-ioncube-4.5.2-1.cp1142.x86_64
cpanel-php54-HTTP-Request-1.4.4-2.cp1142.noarch
cpanel-php54-Net-IMAP-1.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Norway-0.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-PHPdotNet-0.1.2-1.cp1142.noarch
php54-php-process-5.4.37-1.el6.remi.x86_64
cpanel-php54-HTTP-WebDAV-Server-1.0.0RC8-1.cp1142.noarch
cpanel-php54-XML-Serializer-0.20.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Brazil-0.1.2-1.cp1142.noarch
cpanel-php54-Date-Holidays-Iceland-0.1.2-1.cp1142.noarch
php54-php-pear-1.9.5-4.el6.remi.noarch
cpanel-php54-Log-1.12.7-1.cp1142.noarch
cpanel-php54-Net-FTP-1.3.7-3.cp1142.noarch
cpanel-php54-Services-Weather-1.4.7-1.cp1142.noarch
cpanel-php54-Date-Holidays-Austria-0.1.5-1.cp1142.noarch
php-common-5.4.37-1.el6.remi.x86_64
cpanel-php54-File-Find-1.3.2-1.cp1142.noarch

My answer:


Your system has several issues that will make it difficult to clean up:

  • You have two repositories, remi and webtatic, which are not compatible with each other and may attempt to install conflicting packages.
  • Someone has compiled a copy of PHP 5.3.25 from source code and installed it on your system. Such installations are not tracked by package management and will be difficult or impossible to remove.
  • You also have cPanel on this system, which has installed its own PHP packages, that aren’t compatible with any of the others.

The best way to deal with this mess is to install a fresh server and transfer the web application to it (and I would recommend not using cPanel at all). Attempting to clean it up in-place is going to be hours of (billable) work and since cPanel is well known to put systems in strange states even when it’s working normally, you’ll probably require the assistance of cPanel support if you want to do this.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.