Centos Upgrade PHP v5.1 to PHP v5.2

Posted on August 26, 2011 by admin

Method I

Note to self : I find for somereason mailserver (specially smtp) crashes. ISPConfig email services breaks. Someone please tell me why …

Upgrade PHP Version 5.1 to PHP Version 5.2 With Yum On a CentOS Server Running ISPConfig

1.Install Atmoic Yum Repo:
cd /etc/yum.repos.d
wget -q -O – http://www.atomicorp.com/installers/atomic |sh

2.Upgrade PHP:
yum update php

3.Install PHP Packages:
yum install php-mcrypt php-mhash php-mssql php-tidy

4.Restart Apache:
/etc/init.d/httpd restart

5.Verify Error Free Functionality:
tail -f /var/log/httpd/error_log

If no other errors are located you area now running PHP version 5.2 with little effort.

I would suggest going through each site and testing functionality. Also if the server is running ISPConfig or another virtual hosting software package you will need to manually verify phpMyAdmin and the virtual hosting software control panel. Another not as common item that I noticed was the fact that I did not have the 5.2.0 zend_extension loaded so any sites requiring ioncube were not displaying. If you upgraded from PHP version 5.1 then you will need to replace the below in /etc/php.ini.

PHP.ini Zend Ioncube Configuration:

zend_extension = /usr/sbin/ioncube_loader_lin_5.1.so
Replace the Above With:
zend_extension = /usr/sbin/ioncube_loader_lin_5.2.so

Once modified you need to restart Apache for the change to start working. I would check back on the Apache error log every so often to make sure that no other errors pop up without you resolving them quickly.

Method II

Note to self : Possible method for me if I run ISPConfig email services. Someone please tell me why …

rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-8.ius.el5.noarch.rpm

rpm –import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
rpm –import /etc/pki/rpm-gpg/IUS-COMMUNITY-GPG-KEY

yum install yum-plugin-replace

yum replace php –replace-with php53u

yum search php53u

yum install php53u-pear php53u php53u-cli php53u-common php53u-devel php53u-gd php53u-mbstring php53u-mcrypt php53u-mysql php53u-pdo php53u-soap php53u-xml php53u-xmlrpc php53u-bcmath php53u-pecl-apc php53u-pecl-memcache php53u-snmp

php -v

/etc/init.d/httpd restart