Tuesday, February 9, 2010

PHP 5.3 upgrade in Centos 5.3

SkyHi @ Tuesday, February 09, 2010

I’ve finally figured out a way to install PHP 5.2.x instead of PHP 5.1 which installs on CentOS 5.3 by default. I’ve wanted to use phpMyAdmin 3.x but could not because of this. Now I can, and if you keep reading you will too. Note if you follow this how-to and do everything correctly you won’t even loose your current database. But I highly recommend you backup your database before you proceed.


## First lets download this following repositories:


wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/el5.i386/remi-release-5-6.el5.remi.noarch.rpm




## Lets remove old MySQL 5, will install newer version later.
yum remove mysql


## Now lets install them:
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm


## OK, Now you should be able to install PHP 5.2.9 without a problem =)
yum –enablerepo=remi update php-cli
yum –enablerepo=remi update php*


## Now install MySQL
yum –enablerepo=remi install mysql mysql-server
chkconfig -levels 235 mysqld on
service mysqld start


If you get the following error when you try starting newly installed MySQL;
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory


## Now install PHP-MySQL module
yum –enablerepo=remi install php-mysql