Install PHP 5.2 on CentOS 5 (for phpMyAdmin)

phpmyadmin logoIt's pretty annoying to me that the latest version of phpMyAdmin requires PHP 5.2, which as some of you may know, is NOT installed on CentOS 5 by default. Instead, you have to use scary-looking RPM's with the word "testing" in them. So... to remove some of the scaryness/complexity of installing PHP 5.2 on CentOS 5 for use with phpMyAdmin, I've written down the following steps that makes the upgrade process pretty easy.

  1. First install the yum-priorities package. This enables you to specify which repo you want yum to prioritize when it's checking for updates.

    # yum -y install yum-priorities

  2. Next, you'll want to add the scary "CentOS 5 Testing" repository to your listof repo's for YUM to check. You can do that by adding the contents of THIS FILE to your own /etc/yum.conf. I just copied and pasted the contents of that file to the very bottom of my yum.conf and it worked fine.

  3. Now you should be able to perform a PHP upgrade with YUM by specifying that you want to use the "testing" server as a priority:

    # yum --enablerepo=c5-testing upgrade php

    or... if you haven't installed PHP yet:

    # yum --enablerepo=c5-testing -y install php

  4. You will probably also want to install the following modules for use with phpMyAdmin:

    # yum --enablerepo=c5-testing -y install php-mysql php-mcrypt php-mbstring

  5. After you're done installing/upgrading php and all required modules, don't forget to give Apache a quick restart so your upgrades take effect:

    # /etc/init.d/httpd restart
php logo


That's all there is to it! Your phpMyAdmin install should work great now.

 

Comments

1
Ken

Thanks so much for writing this. Saved me a ton of time! That new interface for phpMyAdmin looks nice too!

Write your comment

(it will not be displayed)

Leave this field empty:

overwrought