Dec 03 2009
HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO

HOW TO UPGRADE TO PHP 5.3 ON A CENTOS 5 DISTRO
I am trying to install cahoots a StackOverflow clone but I am running Centos 5 and by default
it comes with php 5.1.6 and I needed to install the Zend Framework. If you tried to install the Zend
framework you will realize that you need PHP 5.2 in order to use it.
I know there are ways to install a new version of PHP on Centos 5, I would not recommend this steps
on a production system at work because you will be using repos that are not supported by Redhat or Centos
so if the maintainer of the repo decides to you are stuck with a version of PHP that is not maintained
by anyone and if there are bugs or security risks you are stuck with a machine that is not supported anymore.
In my case this is my machine so I will install php 5.3 via the REMI repos
wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
Now upgrade php and mysql
yum –enablerepo=remi update php
you will see a bunch of rpm’s being dowloaded and then installed. But you will see this error.
############ ERROR UPGRADING PHP 5.3 #################################################
Transaction Check Error:
file /etc/my.cnf from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/charsets/Index.xml from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/charsets/cp1250.xml from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/czech/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/danish/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/dutch/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/english/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/estonian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/french/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/german/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/greek/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/hungarian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/italian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/japanese/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/korean/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/norwegian-ny/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/norwegian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/polish/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/portuguese/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/romanian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/russian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/serbian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/slovak/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/spanish/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/swedish/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.41-1.el5.remi.i386 conflicts with file from package mysql-5.0.77-3.el5.i386
######### HOW TO FIX THE ABOVE ERROR ##############################
Well that sucked right. It seems some files are conflicting with my original install of MySQL the problem here is that
I am updating PHP but I also needed to update my MySQL to work with php 5.3 so i did the following
[root@penguin-web1 ZendFramework-1.7.8]# yum –enablerepo=remi update mysql
Dependency Installed:
libXaw.i386 0:1.0.2-8.1 libXmu.i386 0:1.0.2-5 libedit.i386 0:2.11-2.20080712cvs.el5 mysql-libs.i386 0:5.1.41-1.el5.remi
mysqlclient15.i386 0:5.0.67-1.el5.remi sqlite2.i386 0:2.8.17-2.el5.remi t1lib.i386 0:5.1.1-7.el5
Updated:
mysql.i386 0:5.1.41-1.el5.remi
Dependency Updated:
mysql-bench.i386 0:5.1.41-1.el5.remi mysql-server.i386 0:5.1.41-1.el5.remi php.i386 0:5.3.1-1.el5.remi php-cli.i386 0:5.3.1-1.el5.remi
php-common.i386 0:5.3.1-1.el5.remi php-devel.i386 0:5.3.1-1.el5.remi php-gd.i386 0:5.3.1-1.el5.remi php-ldap.i386 0:5.3.1-1.el5.remi
php-mbstring.i386 0:5.3.1-1.el5.remi php-mysql.i386 0:5.3.1-1.el5.remi php-pdo.i386 0:5.3.1-1.el5.remi php-snmp.i386 0:5.3.1-1.el5.remi
php-xml.i386 0:5.3.1-1.el5.remi php-xmlrpc.i386 0:5.3.1-1.el5.remi
Complete!
[root@penguin-web1 ZendFramework
################## VERIFY THAT PHP 5.3 HAS BEEN INSTALLED ##########################
[root@penguin-web1 ZendFramework-1.7.8]# php –version
PHP 5.3.1 (cli) (built: Nov 20 2009 17:51:14)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies
[root@penguin-web1 ZendFramework-1.7.8]#
Well this is great, now just reload the httpd server so it can use the new version of php
[root@penguin-web1 ZendFramework-1.7.8]# service httpd reload
Reloading httpd: [ OK ]
[root@penguin-web1 ZendFramework-1.7.8]#
##################### I SCREW UP MY SYSTEM I FUCKED UP AND NOW I AM STUCK WITH A BROKEN APPLICATION OR SYSTEM ##########
Yes what if you had an application that is not working anymore or even apache might not work in that case do this
yum –disablerepo=remi
yum remove php php-cli php-common (It didn’t remove dependencies when uninstalling just php)
yum install php (Reverts back to PHP version in Red Hat’s repositories)
Then restart httpd
Well so those are the steps to upgrade your system to php 5.3
Ciao my fellow Penguin readers
