Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question

migrated from 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 - | 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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.