Installing PHP 5.2 (or 5.3) on RHEL5 the easy way

Just replace the stock PHP with one from the IUS Community project.

wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm
rpm -Uvh ius-release-1.0-6.ius.el5.noarch.rpm
yum install yum-plugin-replace
rpm -qa | grep php
yum replace php --replace-with php52
/sbin/service httpd restart

Done!

Topic: 

Comments

the download work well but the rmp need dependencie :

# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/x86_6
4/ius-release-1.0-6.ius.el5.noarch.rpm
--2010-12-14 09:57:41-- http://dl.iuscommunity.org/pub/ius/stable/Redhat/5.5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm
Resolving dl.iuscommunity.org... 174.143.24.129
Connecting to dl.iuscommunity.org|174.143.24.129|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6656 (6.5K) [application/x-rpm]
Saving to: `ius-release-1.0-6.ius.el5.noarch.rpm'

0% [ ] 0 --.-K/s
100%[======================================>] 6,656 --.-K/s in 0s

2010-12-14 09:57:42 (88.2 MB/s) - `ius-release-1.0-6.ius.el5.noarch.rpm' saved [6656/6656]

# rpm -Uvh ius-release-1.0-6.ius.el5.noarch.rpm
warning: ius-release-1.0-6.ius.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 9cd4953f
error: Failed dependencies:
epel-release is needed by ius-release-1.0-6.ius.el5.noarch

You are correct. I already had EPEL installed as a repository. You can do that with


# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm