Wednesday, November 20, 2013

How to yum install PHP 5.3 for CentOS 5

There is interesting article from Rackspace How to install/upgrade PHP 5.3 for CentOS 5.x

Step 1: Basically, you have to install a repository "webstatic" which is found at 
# wget http://repo.webtatic.com/yum/centos/5/latest.rpm
# rpm -Uvh latest.rpm
# yum check-update

Step 2: Enable WebStatic (enabled=1)
[webtatic]
name=Webtatic Repository $releasever - $basearch
#baseurl=http://repo.webtatic.com/yum/centos/5/$basearch/
mirrorlist=http://mirror.webtatic.com/yum/centos/5/$basearch/mirrorlist
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-webtatic-andy

Step 3a: Do a Yum Install
# yum install php php-cli php-gd php-mysql php-mbstring

Step 3b: If you are upgrading, do a yum upgrade
# yum upgrade php

Step 4: Restart the Web Server
# service httpd restart

Step 5: Check the PHP version
[root@web ~]# php -v
PHP 5.3.27 (cli) (built: Jul 13 2013 22:19:28)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

No comments: