How to upgrade to latest PHP, MySQL, and phpmyadmin on CentOS 5.8 (32bit)?

21,749

Solution 1

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 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]

Solution 2

# yum install --enablerepo=ius-archive php53u-mysql
# yum install --enablerepo=ius-archive phpMyAdmin3

Works now on RHEL 5.5

Share:
21,749

Related videos on Youtube

Michael Ecklund
Author by

Michael Ecklund

Hello, my name is Michael Ecklund, and I am an experienced Minnesota Web Designer. I've professionally built custom tailored websites for local people and businesses in the Minneapolis, Minnesota, United States area since 2008. As a professional Minnesota Website Developer, I understand what it takes to correctly and efficiently power your website using the WordPress* platform as a sleek and elegant choice for a content management system. WordPress powers well over 60 million websites. To this day, WordPress is powering 14.7% of the top million websites in the world, up from 8.5% and 22 out of every 100 new active domains in the United States alone, are running WordPress to power the place on the web, they call "home". I am a self-educated and self-motivated Minnesota WordPress Developer, always utilizing cutting-edge techniques to get the most out of your WordPress website. Saving you time and money, by allowing you to easily manage your own website, without the need of hiring an extra IT administrator or webmaster. Please feel free to browse through my WordPress Stack Exchange profile to view both my questions and my answers to other questions asked by community members like yourself.

Updated on September 18, 2022

Comments

  • Michael Ecklund
    Michael Ecklund over 1 year

    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.

  • Michael Ecklund
    Michael Ecklund almost 12 years
    Could you please edit your answer with commands for doing what you did?
  • Zim3r
    Zim3r almost 12 years
    Yes Sure, I edited my answer.
  • Zim3r
    Zim3r almost 12 years
    Of Course, Added that step.
  • Zim3r
    Zim3r almost 12 years
    your welcome, added phpMyAdmin section.
  • Zim3r
    Zim3r almost 12 years
    what if you download phpMyAdmin form phpmyadmin.net/home_page/downloads.php and edit the config manually?
  • Shackrock
    Shackrock almost 11 years
    How would anyone new to CentOS/Linux EVER figure this out? And I'm not joking here. Does this guide still hold true today (a year after it was posted)?
  • Zim3r
    Zim3r almost 11 years
    They will definitely figure this out. You can ask whoever accepted this answer and voted up. and what do you exactly want to earn from this comment?
  • Deer Hunter
    Deer Hunter over 9 years
    Not the latest...