php version 5.3.x

Hello how can i upgrade my php on my Server to 5.3.x current version is 5.2.x Thank You

Status: 
Active

Comments

PHP 5.3.x is an optional package (named "php53") that comes with CentOS 5.6. You can use it in place of your current PHP version.

Note that many PHP applications do not yet work with PHP 5.3, so we'd recommend verifying that all of your applications will continue work before changing your PHP version.

We'd also suggest testing this process on a test server -- making large changes such as this to PHP on a live server can cause unexpected results.

The process of moving to PHP 5.3 is not as straight forward as the process of moving to PHP 5.2.

If you're still interested -- there's several steps involved in switching:

First, you'll need to get a list of which PHP packages you currently have installed, which you can do by running this command:

rpm -qa 'php*'

Next, you'll have to remove all the PHP packages it shows you. You can do that by running this command:

yum remove php*

Then, you'll need to install the "php53" version of all those packages you just removed. For example, instead of "php-mysql", you'll want to install "php53-mysql". Instead of "php-common", you'll want "php53-common".

You can install them by running:

yum install php53 php53-common php53-mysql (insert the rest of your PHP package names on the command line here)

Again, we'd suggest testing all that on test server before changing your live server, it's a rather big change :-)

Please note, that this doesn't work if you need Pear for PHP. The main reason is basically that there doesn't seem to be a php53-pear package in Centos?