Upgrade PHP to higher version (5.4) on RedHat 5

 Problem Description : 

RHEL stock packages only include PHP 5.3.3. In order to get a higher version of PHP you can use the IUS repository which regularly maintains RPM packages for the latest upstream versions of PHP, Python, MySQL and other common software specifically for Redhat Enterprise Linux.

 

 

 Resolution : 

 

Based on instructions found at https://iuscommunity.org/pages/IUSClientUsageGuide.html.

 

NOTE: For CentOS replace wget commands below with http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/ius-release-1.0-13.ius.centos5.noarch.rpm and http://dl.iuscommunity.org/pub/ius/stable/CentOS/5/x86_64/epel-release-5-4.noarch.rpm

 

[root@gscweb ~]# rpm -qa | grep php

 

Remove old php packages from 'Add Remove software' (uncheck php53 boxes and apply)

 

[root@gscweb ~]# rpm -qa | grep php

 

command should show nothing

 

Install IUS repository and EPEL - used this link to find latest packages to use (http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/?C=N;O=A)

 

[root@gscweb ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-13.ius.el5.noarch.rpm 

--2014-09-05 11:20:21-- http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-13.ius.el5.noarch.rpm

Resolving dl.iuscommunity.org... 50.57.54.209

Connecting to dl.iuscommunity.org|50.57.54.209|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 7847 (7.7K) [application/x-rpm]

Saving to: `ius-release-1.0-13.ius.el5.noarch.rpm'

 

100%[======================================>] 7,847 --.-K/s in 0.02s 

 

2014-09-05 11:20:21 (361 KB/s) - `ius-release-1.0-13.ius.el5.noarch.rpm' saved [7847/7847]

 

[root@gscweb ~]# ll 

 

look for package

 

[root@gscweb ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm

 

--2014-09-05 11:21:53-- http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm

 

Resolving dl.iuscommunity.org... 50.57.54.209

Connecting to dl.iuscommunity.org|50.57.54.209|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 12275 (12K) [application/x-rpm]

Saving to: `epel-release-5-4.noarch.rpm'

 

100%[======================================>] 12,275 --.-K/s in 0.02s 

 

2014-09-05 11:21:53 (564 KB/s) - `epel-release-5-4.noarch.rpm' saved [12275/12275]

 

[root@gscweb ~]# ll

 

look for package

 

[root@gscweb ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm 

warning: ius-release-1.0-13.ius.el5.noarch.rpm: Header V4 DSA signature: NOKEY, key ID 9cd4953f

Preparing... ########################################### [100%]

1:epel-release ########################################### [ 50%]

2:ius-release ########################################### [100%]

 

 

[root@gscweb ~]# yum list | grep -w \.ius\.

 

shows packages available from IUS

 

Go to 'Add Remove Software' find PHP5.4 packages that you need and check the boxes and apply

 

Will ask to install keys during processing.

 

Make sure php is updated...

 

[root@gscweb ~]# php -v

PHP 5.4.32 (cli) (built: Aug 22 2014 11:03:37) 

Copyright (c) 1997-2014 The PHP Group

Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies  

 

 

 

 

 Revision Date : 10/1/2014

 

Article Details

Article ID:
27
Category:
Rating :

Related articles