You are here

Upgrading CentOS 6 to PHP 5.4 (or 5.5)

  • SCL is the way to go since it has RedHat’s blessing

Note that it is the .conf file that controls which version of php is used. For some reason this does not seem to be available for php55. It is possible that anther package needs to be installed, containing libphp5.so.

yum install -y centos-release-SCL scl-utils && yum clean all && yum makecache
  • check possible modules you might wish to install with:
rpm -qa | grep php

P=php54-php
yum install -y \
  php54 \
  $P \
  $P-devel \
  $P-gd \
  $P-imap \
  $P-ldap \
  $P-mbstring \
  $P-mysqlnd \
  $P-odbc \
  $P-xmlrpc # and $P-opcache for php 5.5
  • Activate PHP 5.4 permanently:
source /opt/rh/php54/enable
  • Disable old PHP 5.3 Apache module from loading:
    • Should now have /etc/httpd/conf.d/php54-php.conf which loads correct PHP 5.4 module for Apache.
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/php.conf-5.3
service httpd restart