Upgrade CentOS 5.4 PHP 5.2 to PHP 5.3

1. Stop HTTPD

service httpd stop

2. Remove all previous PHP installations

yum remove php

yum remove php-*

3. Set up EPEL/IUS Repo

wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-11.ius.el5.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
rpm -Uvh ius-release*.rpm epel-release*.rpm

note the red texts should be checked and updated depending on if the CentOS is 32bit or 64bit version. The versions of the rpm files could update too. please check before you run the command.

4. Install PHP 5.3

yum install 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



note php 5.3 by default disable short open tag <? code…. ?>, so you want to modify your php.ini and change it to

short_open_tag = On


Read More