Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

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:

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 phpMyAdmin*3*:

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]
share|improve this answer
    
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
    
phpmyadmin3 didnt work because it requires php53 for everything. –  Michael Ecklund Jul 29 '12 at 6:44
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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