Centos – Upgrade php v4.3.9 to php 5+ on CentOS 4.8

centosPHP

I am currently running CentOS v 4.8 and it has PHP version 4.3.9 installed on it. I want to update to the latest PHP version, 5.2 or above, however, I'm not sure how to go about doing this.

I read that doing a yum update php might cause issues with the existing php installation?

I read somewhere that there are external repositories that help doing this as well. Are there any reocmmendations?

The server is live, so I don't want to ruin it by an update. Any precautions to keep in mind? I intend to backup the mySQL database and all the files as well. Anything else I should keep in mind?

I read a post on this site by coops, recommending atomic repos, is this recommended in my situation?

wget -q -O - http://www.atomicorp.com/installers/atomic.sh | sh
yum update php
service httpd restart

Is these the right steps to install the Remi repo? I'm using Enterprise Linux (RHEL, CentOS) :

su -
cd /etc/yum.repos.d
wget http://rpms.famillecollet.com/enterprise/remi.repo
yum --enablerepo=remi update php-\*

Output after running yum list php

Error: Bad repository file ///etc/yum.repos.d/CentOS-Testing.repo, no repo stanzas.
Setting up repositories
Reading repository metadata in from local files
Installed Packages
php.i386                                 5.2.14-2.el4.art       installed

I had to install the atomic repo. Since I was getting the following error with REMI:

warning: rpmts_HdrFromFdno: V3 DSA signature: NOKEY, key ID 00f97f56
Public key for php-pgsql-5.3.3-1.el4.remi.i386.rpm is not installed
Retrieving GPG key from http://rpms.famillecollet.com/RPM-GPG-KEY-remi


GPG key retrieval failed: [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')>

Best Answer

RHEL4 (what CentOS 4 is derived from) has reached the end production phase and will be end of life in January 2014. More information can be found on the Red Hat Enterprise Linux Life Cycle page. I suggest you put your effort into upgrading to CentOS 6 rather than spending time and energy on a distribution which soon become unsupported.

Barring that what Eddie suggested is going to be your next best choice, installing php from source. However there may be additional dependency issues making the whole process a potential mess.

I recommend you upgrade to RHEL6 or CentOS6. Yes this upgrade will take time, but it may end up taking less time than getting php 5 to run without issue on CentOS 4.