20110824 using ius repo to update php - plembo/onemoretech GitHub Wiki

title: using ius repo to update php on rhel 5 link: https://onemoretech.wordpress.com/2011/08/24/using-ius-repo-to-update-php/ author: lembobro description: post_id: 878 created: 2011/08/24 01:12:13 created_gmt: 2011/08/24 05:12:13 comment_status: closed post_name: using-ius-repo-to-update-php status: publish post_type: post

using ius repo to update php on rhel 5

The "IUS" in the IUS Community Project stands for "In Line with Upstream". It grew out of the need by Rackspace Hosting for newer versions of some Red Hat Enterprise Linux (RHEL) packages. I've been testing it as a possible source for php 5.2.3 or later to support a new MediaWiki deployment on RHEL 5. My results after the jump. Getting the IUS repo up and running is pretty straightforward. One important point to emphasize is that IUS is designed to work with the upstream product and EPEL repos. When using IUS, be sure that you've also got EPEL enabled. In my testing I found the yum replace command to be the easiest and most reliable way to make wholesale updates to packages and package sets. This is an add-on capability provided by the yum-plugin-replace package from the IUS repo. Note: yum-plugin-replace is not installed by default on Red Hat and its clones, you need to be configured to use the IUS repo and then do a "yum install yum-plugin-replace" to get this feature. For example, on one machine I wanted to replace the shipping php version for RHEL 5, 5.1.6, with the newer 5.2.17 version from IUS (this was a dependency to install the latest mediawiki distro). So I ran: `

yum replace php --replace-with php52

My initial try failed because of an EPEL package that conflicted with the newer ones, php-pecl-json. The solution was to temporarily remove the offending package and re-run the replace command. If I really need it I can always reinstall "the old fashioned way" using pecl. If you see an error like this:

WARNING: Unable to resolve all providers: ['config(php-common)', 'dbase.so()(64bit)', 'php-dbase',
'config(php-pdo)', 'php-pcntl', 'config(php-mysql)', 
'config(php-pgsql)', 'config(php-ldap)', 'config(php)',
'config(php-mbstring)', 'config(php-gd)']

Just enter 'y' to continue. Pay careful attention to the packages removed and added. These will be summarized when the command completes. For example in my case:

Removed:
  php.x86_64 0:5.1.6-27.el5_5.3            php-cli.x86_64 0:5.1.6-27.el5_5.3     php-common.x86_64 0:5.1.6-27.el5_5.3  
  php-devel.x86_64 0:5.1.6-27.el5_5.3      php-gd.x86_64 0:5.1.6-27.el5_5.3      php-ldap.x86_64 0:5.1.6-27.el5_5.3    
  php-mbstring.x86_64 0:5.1.6-27.el5_5.3   php-mysql.x86_64 0:5.1.6-27.el5_5.3   php-pdo.x86_64 0:5.1.6-27.el5_5.3     
  php-pear.noarch 1:1.4.9-6.el5            php-pgsql.x86_64 0:5.1.6-27.el5_5.3  

Installed:
  php52.x86_64 0:5.2.17-1.ius.el5                             php52-cli.x86_64 0:5.2.17-1.ius.el5                     
  php52-common.x86_64 0:5.2.17-1.ius.el5                      php52-devel.x86_64 0:5.2.17-1.ius.el5                   
  php52-gd.x86_64 0:5.2.17-1.ius.el5                          php52-ldap.x86_64 0:5.2.17-1.ius.el5                    
  php52-mbstring.x86_64 0:5.2.17-1.ius.el5                    php52-mssql.x86_64 0:5.2.17-1.ius.el5                   
  php52-mysql.x86_64 0:5.2.17-1.ius.el5                       php52-pdo.x86_64 0:5.2.17-1.ius.el5                     
  php52-pear.noarch 1:1.9.4-1.ius.el5                         php52-pgsql.x86_64 0:5.2.17-1.ius.el5                   

Dependency Installed:
  freetds.x86_64 0:0.64-11.el5.centos                                                                                  

Complete!

Now in my case I has so much fun using yum replace that I decided to up the ante and move up from php52 to php53u (5.3.6), the latest stable release IUS has for RHEL 5 (because, after all, I get paid to know what will happen if someone tries it).

yum replace php52 --replace-with php53u

Some interesting (and unexpected) results from that operation bear highlighting here:

Removed:
  php52.x86_64 0:5.2.17-1.ius.el5                             php52-cli.x86_64 0:5.2.17-1.ius.el5                     
  php52-common.x86_64 0:5.2.17-1.ius.el5                      php52-devel.x86_64 0:5.2.17-1.ius.el5                   
  php52-gd.x86_64 0:5.2.17-1.ius.el5                          php52-ldap.x86_64 0:5.2.17-1.ius.el5                    
  php52-mbstring.x86_64 0:5.2.17-1.ius.el5                    php52-mssql.x86_64 0:5.2.17-1.ius.el5                   
  php52-mysql.x86_64 0:5.2.17-1.ius.el5                       php52-pdo.x86_64 0:5.2.17-1.ius.el5                     
  php52-pear.noarch 1:1.9.4-1.ius.el5                         php52-pgsql.x86_64 0:5.2.17-1.ius.el5                   

Installed:
  php53u.x86_64 0:5.3.6-4.ius.el5                            php53u-cli.x86_64 0:5.3.6-4.ius.el5                      
  php53u-common.x86_64 0:5.3.6-4.ius.el5                     php53u-devel.x86_64 0:5.3.6-4.ius.el5                    
  php53u-gd.x86_64 0:5.3.6-4.ius.el5                         php53u-ldap.x86_64 0:5.3.6-4.ius.el5                     
  php53u-mbstring.x86_64 0:5.3.6-4.ius.el5                   php53u-mssql.x86_64 0:5.3.6-4.ius.el5                    
  php53u-mysql.x86_64 0:5.3.6-4.ius.el5                      php53u-odbc.x86_64 0:5.3.6-4.ius.el5                     
  php53u-pdo.x86_64 0:5.3.6-4.ius.el5                        php53u-pear.noarch 1:1.9.4-2.ius.el5                     
  php53u-pgsql.x86_64 0:5.3.6-4.ius.el5                      php53u-process.x86_64 0:5.3.6-4.ius.el5                  
  php53u-pspell.x86_64 0:5.3.6-4.ius.el5                    

Dependency Installed:
  libedit.x86_64 0:20090923-3.0_1.el5.rf                         t1lib.x86_64 0:5.1.2-1.el5.rf               

` (libedit is a replacement for GNU readline used by a variety of other packages, and t1lib is used for generating font bitmaps -- both come from the rpmforge repo) Oh, and what about json support? Turns out it is built in to 5.3.6 and so doesn't need to be added via pecl.

Copyright 2004-2019 Phil Lembo