I have searched around on the internet and cannot find a reliable source for installing the latest versions of PHP, MySQL, and phpmyadmin on CentOS 5.8 32bit with apache. I have tried a couple times, with no luck. Each time corrupted my server.

I'm tired of assuming what's correct and screwing up my server / wasting time. I figured I would come here to get a legitimate answer that actually works, straight from the community that knows what they're actually doing.

It would also be cool if it could be done with YUM for automatic future updates.


I installed IUS and RPM Forge Release and then removed old packages. with a dump from MySQL for sure. and then re-installed PHP54 and MySQL55.

assuming it's CentOS/RHL 5 and you have old PHP & MySQL installed

first find all packges related to php by:

rpm -qa | grep php

then remove matched packages:

yum remove [packages]

then search for mysql:

rpm -qa | grep mysql

again remove matched packages:

yum remove [packages]

now install IUS & RPMForge release for latest versions of PHP and MySQL:

wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.i386.rpm

Install DAG's GPG key :

rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt

then install those rpms:

rpm -i epel-release-5-4.noarch.rpm
rpm -i ius-release-1.0-10.ius.el5.noarch.rpm
rpm -i rpmforge-release-0.5.2-2.el5.rf.*.rpm

now check for an update:

yum update

to install PHP54 & MySQL55:

yum install php54 mysql55-server

all dependencies will be installed

to install module for PHP applications that use MySQL databases:

yum install php54-mysql

restart apache:

service httpd restart

run mysql secure installation:


restart mysqld:

service mysqld restart

I think It's done.

and for exporting MySQL database:

mysqldump -u root -p --all-databases > all_databases.sql

to import that database I think this works:

mysql -u root -p < all_databases.sql

as you installed IUS release you can easily download latest versions of phpMyAdmin:

assuming you have installd phpMyAdmin package. remove it first:

yum remove phpMyAdmin

install phpMyAdmin3:

yum install phpMyAdmin3

then look for phpMyAdmin directory where files are stored:

whereis phpMyAdmin 

make a symbolic link of the directory that contains phpMyAdmin management interface where it is accessible from Apache

ln -s [phpMyAdmin Directory]

if you recive forbidden error while accessing phpMyAdmin from browser try this:

chown -h [user]:[group] [Path to phpMyAdmin  symbolic link]
  • Could you please edit your answer with commands for doing what you did? – Michael Ecklund Jul 29 '12 at 5:06
  • Yes Sure, I edited my answer. – Zim3r Jul 29 '12 at 5:28
  • Of Course, Added that step. – Zim3r Jul 29 '12 at 5:33
  • your welcome, added phpMyAdmin section. – Zim3r Jul 29 '12 at 5:58
  • 1
    phpmyadmin3 didnt work because it requires php53 for everything. – Michael Ecklund Jul 29 '12 at 6:44
# yum install --enablerepo=ius-archive php53u-mysql
# yum install --enablerepo=ius-archive phpMyAdmin3

Works now on RHEL 5.5


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.