PHP5 for CentOS 4.4

Submitted by str on Tue, 02/27/2007 - 23:13

I’m using right now CentoS 4.4 and PHP5 is not yet part of the rpm package. I can always download the source and compile it or search some pre-pack PHP5 RPM and install it.

Alternatively, here’s how to do it using the good old yum one liner command.

Edit CentOS-Base.repo
vi /etc/yum.repos.d/CentOS-Base.repo
Enable CentOSPlus by changing:

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
to:
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4

Run yum
yum install php – to freshly install PHP5
Or
yum update php - to update PHP5 (in case PHP4 was already installed)
Restart Apache
/etc/init.d/httpd restart