I need to upgrade PHP version on my dedicated server. I currently have 5.1.6 (apache2handler) installed. I have not done this before, therefore a bit nervous.

Also my OS: Apache Version (Apache/2.2.3 (CentOS))

Quick search shows that all I need to do is run up2dat/yum or apt-get.

I assume I need to login as root using shell program, like putty, right? Do I go to the root level and then type up2dat/yum?

Do I need to back up all my sites or this upgrade should not affect my storage?

I am not sure I want to go though removing PHP and installing new one. I am not really savvy in server administration and the prospect of loosing some of my custom setups does not sit well... Any news on perhaps them making it available via normal upgrade?

A bit confused.

migrated from stackoverflow.com Apr 1 '11 at 15:37

This question came from our site for professional and enthusiast programmers.


If you are using the standard versions of PHP from the CentOS repositories, upgrading is really simple.

I like to use the Atomicorp yum repository. They have PHP 5.2, and are frequently updated for the latest versions of the LAMP stack.

It's a simple as installing the atomic repository:

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

Then, you update php.

yum update php*

I recommend backing up the apache /etc/httpd/conf and /etc/httpd/conf.d configuration files just to be safe, although I've never encountered a problem with the upgrade process.


The best way to go about this would be to add a third-party repository that has recent php5 packages.

I personally recommend the IUS repository, it is a community project backed by Rackspace. They mostly maintain packages pertaining to web servers, databases and dynamic languages. In short: all the stuff you need to run an up to date web-server on CentOS.

There is a wiki page explaining how to use IUS and replace your old php packages with php53.


Quick search shows that all I need to do is run up2dat/yum or apt-get.

This isn't going to be correct, unfortunately:

Also my OS: Apache Version (Apache/2.2.3 (CentOS))

CentOS is based on Red Hat Enterprise Linux, which has pegged the php package at 5.1.6 for freaking ages.

The latest point-release, 5.6, makes a new php53 package available. You would need to remove the old php package and install the new php53 package. However, it seems that not all of the same extensions are available (or so others may have said), you might need to do a bit of research on your existing configuration and installed packages first.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy