In this howto i will describe how to update PHP rpms on servers to latest version. If you have server running CentOS/Fedora/RHEL, you will noticed that it will use regular rpms of distro to install PHP and to update you have to restrict yourself with distro update of said rpms of PHP, which can be not a major update.

Like in CentOS 5.3 you cannot update PHP version above 5.1.x. I have been using different repositories to update PHP to latest version but most of them break rpm one or two, which may let to unstable Server.

AtomicRocketTurtle (http://www.atomicrocketturtle.com/) company i found that regularly updating applications used in CentOS/Fedora/RHEL. You will be seeing that i will be updating PHP from version 5.1.x to 5.2.12, which is latest till this date.

1) Install AtomicRocketTurtle Repository.

Pre-requisite of atomicrocketturtle repository is yum, you should be confirm that you have yum install specially on CentOS. Some of the VPS comes without yum installation, so if your server doesnt have yum on CentOS 5.x, use following my post to install yum. http://www.sohailriaz.com/howto-install-yum-on-centos-52-vps/

To install atomicrocketturtle repository run following command.

wget -q -O – http://www.atomicorp.com/installers/atomic.sh | sh

This script will automatically detect your OS and install approperiate repository.

2) Update PHP

First check the available PHP version on atomic repository

yum list | grep atomic | grep php

Get the list of your install rpm and update following.

rpm -qa | grep php
php-cli-5.1.6-23.2.el5_3
php-5.1.6-23.2.el5_3
php-gd-5.1.6-23.2.el5_3
php-pdo-5.1.6-23.2.el5_3
php-common-5.1.6-23.2.el5_3
php-imap-5.1.6-23.2.el5_3
php-xml-5.1.6-23.2.el5_3
php-mbstring-5.1.6-23.2.el5_3
php-mysql-5.1.6-23.2.el5_3

It can be different for you, just create the list like below i used for update PHP. I used every package name as i dont want to miss any of the module it has.

yum update php php-cli php-gd php-pdo php-common php-imap php-xml php-mbstring php-mysql

at end you will see this

Updated: php.i386 0:5.2.12-3.el5.art php-cli.i386 0:5.2.12-3.el5.art php-common.i386 0:5.2.12-3.el5.art php-gd.i386 0:5.2.12-3.el5.art php-imap.i386 0:5.2.12-3.el5.art php-mbstring.i386 0:5.2.12-3.el5.art php-mysql.i386 0:5.2.12-3.el5.art php-pdo.i386 0:5.2.12-3.el5.art php-xml.i386 0:5.2.12-3.el5.art
Complete!

If you have any question please use comments.

pixelstats trackingpixel