Updated Packages of PHP/MySQL/Python/Etc Available for RHEL5
drks — Thu, 2009-09-10 23:38
A new project has emerged called the IUS Community Project. What is that you ask? Well, IUS stands for 'Inline with Upstream Stable'. The project is geared toward creating and maintaining rpm packages of the latest stable versions of software such as PHP/MySQL/Python/Etc on Red Hat Enterprise Linux and CentOS (and others). Therefore, by using the IUS yum repositories you can easily upgrade your old and crummy php-5.1.6 to the latest and greatest php-5.2.10, and then continue to stay inline with the upstream version as it is released (5.2.11, 5.2.12, etc). There are also packages available for PHP 5.3, MySQL 5.0, MySQL 5.1, Python 2.6, and others.
If it isn't obvious to anyone, it will be eventually... I am indeed the one who is leading the IUS Community Project and hope to get the word out there for others to benefit. You can google search all day and find blog after blog after blog on howto upgrade PHP on RHEL5, or howto upgrade MySQL on RHELX and you will have pages and pages of examples. That said, IUS offers a better way to upgrade RHEL because the repository is maintained by professional linux engineers as well as a community of contributors helping the repository grow as newer branches of your favorite software becomes available upstream.
To help get you started, here are a few quick examples:
Setting Up Your RHEL or CentOS Box To Use IUS
[root@el5-i386 ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-1-1.ius.el5.noarch.rpm [root@el5-i386 ~]# wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1-2.ius.el5.noarch.rpm [root@el5-i386 ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm warning: ius-release-1-2.ius.el5.noarch.rpm: Header V3 DSA signature: NOKEY, key ID 9cd4953f Preparing... ########################################### [100%] 1:epel-release ########################################### [ 50%] 2:ius-release ########################################### [100%]
Note: you may need to change the URL to suit your OS Distro and Arch.
Howto Upgrade PHP on RHEL or CentOS 5
For PHP we are going to upgrade from the stock php-5.1.6 to php52-5.2.10. Notice the different naming convention. The IUS php52 package provides 'php' so any other packages looking for 'php' will find it. That said, it is a different package that conflicts with 'php' which is why we need to remove 'php' first before installing the 'php52' conterpart. We use --nodeps here, which is not recommended in any other situation unless you know what you are doing and you know that you are replacing that package set with something that resolves those dependencies.
[root@el5-i386 ~]# rpm -qa | grep php- | grep -v 'php-pear' php-mbstring-5.1.6-23.2.el5_3 php-odbc-5.1.6-23.2.el5_3 php-imap-5.1.6-23.2.el5_3 php-pdo-5.1.6-23.2.el5_3 php-common-5.1.6-23.2.el5_3 php-gd-5.1.6-23.2.el5_3 php-ldap-5.1.6-23.2.el5_3 php-cli-5.1.6-23.2.el5_3 php-mysql-5.1.6-23.2.el5_3 php-5.1.6-23.2.el5_3 php-xml-5.1.6-23.2.el5_3 [root@el5-i386 ~]# rpm -e php-mbstring php-odbc php-imap php-pdo php-common php-gd php-ldap php-cli php-mysql php php-xml --nodeps [root@el5-i386 ~]# yum install php52-mbstring php52-odbc php52-imap php52-pdo php52-common php52-gd php52-ldap php52-cli php52-mysql php52 php52-xml ... snipped output ... Installed: php52.i386 0:5.2.10-4.ius.el5 php52-cli.i386 0:5.2.10-4.ius.el5 php52-common.i386 0:5.2.10-4.ius.el5 php52-gd.i386 0:5.2.10-4.ius.el5 php52-imap.i386 0:5.2.10-4.ius.el5 php52-ldap.i386 0:5.2.10-4.ius.el5 php52-mbstring.i386 0:5.2.10-4.ius.el5 php52-mysql.i386 0:5.2.10-4.ius.el5 php52-odbc.i386 0:5.2.10-4.ius.el5 php52-pdo.i386 0:5.2.10-4.ius.el5 php52-xml.i386 0:5.2.10-4.ius.el5 Complete! [root@el5-i386 ~]# php -v PHP 5.2.10 (cli) (built: Sep 4 2009 12:10:34) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
And there you have it, the latest version of PHP 5.2, that will be maintained for future updates as they are released upstream. Take note that you can also upgrade to PHP 5.3 this easily as well. So if you are asking, "Howto upgrade to PHP 5.3 on RHEL or CentOS 5" simply replace 'php52' with 'php53' for each of the previous examples listed in the code above.
Howto Upgrade MySQL on RHEL or CentOS 5
Upgrading MySQL using the IUS packages is actually easier, however you want to take care to make a proper backup of your database before making any changes. This can be done in the easiest form by doing a mysqldump of all databases in one command. The following outlines how to upgrade to MySQL 5.1 on RHEL or CentOS 5:
[root@el5-i386 ~]# mysqldump -A > /root/all_databases.sql.backup [root@el5-i386 ~]# rpm -qa | grep mysql libdbi-dbd-mysql-0.8.1a-1.2.2 mysql-5.0.45-7.el5 mysql-connector-odbc-3.51.12-2.2 mysql-devel-5.0.45-7.el5 php52-mysql-5.2.10-4.ius.el5 mysql-server-5.0.45-7.el5 [root@el5-i386 ~]# /etc/init.d/mysqld stop Stopping MySQL: [ OK ] [root@el5-i386 ~]# rpm -e mysql mysql-server mysql-devel --nodeps [root@el5-i386 ~]# yum install mysql51 mysql51-server mysql51-devel ... snipped output ... Installed: mysql51.i386 0:5.1.37-2.ius.el5 mysql51-devel.i386 0:5.1.37-2.ius.el5 mysql51-server.i386 0:5.1.37-2.ius.el5 Dependency Installed: mysqlclient15.i386 0:5.0.84-1.ius.el5 mysqlclient15-devel.i386 0:5.0.84-1.ius.el5 Complete! [root@el5-i386 ~]# /etc/init.d/mysqld start Starting MySQL: [ OK ] [root@el5-i386 ~]# mysql_upgrade -t /tmp [root@el5-i386 ~]# mysql -V mysql Ver 14.14 Distrib 5.1.37, for redhat-linux-gnu (i686) using readline 5.1
Howto Upgrade Python on RHEL or CentOS 5
The following gives a quick example of how you can upgrade Python on RHEL or CentOS 5. Please note, you should NEVER remove or upgrade the system python that is installed by your distro because so many critical applications rely on it. For that reason, IUS provides a parallel install of Python allowing you to have both the stock version and the newer version installed and available.
[root@el5-i386 ~]# yum install python26 python26-setuptools ... output snipped ... Installed: python26.i386 0:2.6-4.6.ius.el5 python26-setuptools.noarch 0:0.6c9-1.1.ius.el5 Dependency Installed: python26-devel.i386 0:2.6-4.6.ius.el5 python26-libs.i386 0:2.6-4.6.ius.el5 Complete! [root@el5-i386 ~]# python2.6 -V Python 2.6 [root@el5-i386 ~]# easy_install-2.6 sqlalchemy
And now because we have python26-setuptools and were able to easy_install directly to our Python 2.6 install, we can import out eggs:
[root@el5-i386 ~]# python2.6 Python 2.6 (r26:66714, Aug 23 2009, 05:43:27) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlalchemy >>>
Conclusion
As you can see... within just a few minutes time we have just upgraded PHP, MySQL, and Python on a RHEL or CentOS 5 box. Pretty easy right? But its not only easy, its also smart! IUS packages are maintained and updated for bug/security fixes, and you'll receive them simply because you are subscribed to the IUS yum repo.
References
IUS Community Project: http://iuscommunity.org
IUS Yum Repository: http://dl.iuscommunity.org/pub/ius
IUS Community Bug and Feature Request Tracking: http://bugs.launchpad.net/ius
RSS Feed
Thanks for IUS
jeffatrackaid (not verified) — Mon, 2010-02-01 12:49Thanks for IUS. I am not sure how you are reaching out to others for assistance or if Rackspace is providing sufficient backing, but if there's some way we can contribute, let me know.
I've found the SRPMs for PHP a great starting point for some custom RPMs our clients need.
Still a little curious why you do the name change for something like PHP to PHP52? Is that just to make it easier to spot on a system?
Also rather than relying on EPEL would it be best to bring in those dependencies into the IUS repositories? I know its is extra work but I've found people who've had issues by forgetting EPEL is enabled an updating RPMs inadvertently.
Glad to have some RPMs from a source which I feel I can trust.
Jeff, Thanks for the
drks — Thu, 2010-02-18 07:48Jeff,
Thanks for the comments. As far as assistance, what we really need are users and feedback. The naming convention of packages (php to php52, etc) is explained in our FAQ (http://iuscommunity.org/faq), however the primary purpose is keeping packages from IUS obviously separate from RHEL (and so they don't interfere with RHEL). Providing updated packages named 'php' would mean subscribing to the IUS repo you'd automatically update to our packages. We value explicit over implicit and don't want anything to upgrade unless the user makes the required changes.
As far as EPEL we feel this is a perfect combination of repositories. EPEL does not upgrade or conflict with any packages in RHEL so there should not be any packages that are updating inadvertently unless the update is in EPEL for an EPEL package. We want to make IUS accessible alongside EPEL, rather than duplicating efforts with EPEL.
Thank you for the solid feedback!
Apologies, I fixed the first
drks — Wed, 2009-11-11 02:39Apologies, I fixed the first section... should have [and now is] referencing the wget of both epel-release and ius-release.
Problem with directions
Anonymous (not verified) — Thu, 2009-10-29 22:33You are wgetting the same file twice, instead of getting two different files...
Perfect... but a little error
Fredo (not verified) — Sat, 2009-10-24 16:23Works just fine for me for CentOS5.3 under Plesk 8.6. There is an error in "Setting Up Your RHEL or CentOS Box To Use IUS" ! The first URL should end with .../ius-release-1-2.ius.el5.noarch.rpm
Thanks!
Congrats , good article.
dywan (not verified) — Mon, 2009-09-21 13:11Congrats , good article.
Very nice, but ...
Peak (not verified) — Tue, 2009-09-15 01:401. The instructions in "Setting Up Your RHEL or CentOS Box To Use IUS" are (obviously) wrong. Could you please correct them?
2. Any chance of including MySQL-python (i.e. mysqldb)? (*)
Thanks!
(*) http://sourceforge.net/projects/mysql-python
python26-mysqldb currently
drks — Wed, 2009-11-11 02:40python26-mysqldb currently exists in ius-el5 stable.
Post new comment