PHP: Remove 5.3 and install 5.2 Centos 5.2 Step by Step

Hi All

Whilst i know there are already guides on how to do this i need step by step instructions on how to remove or degrade (if you can do that) from PhP 5.3 down to 5.2 on a live site.

I am currently running a vps server using Centos to emulate the removal process before doing it for real.

Can someone please provide a step by step list on how to best perform the operation.

many thanks

Alex md @ be
alexmdbeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
jlevieConnect With a Mentor Commented:
The default contents of /etc/yum.repos.d would be:

CentOS-Base.repo  CentOS-Media.repo

If there are other files in that directory they would include other repositories. you can disable those by appending ".not" to the file name(s). Then check to see that CenytOS-Base.repo contains only:

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
0
 
jlevieCommented:
First get the rpm for the version of PHP that you wish to install. If you are running in 64 bit mode, get the x86_64 version instead of the i386 version. Then execute:

rpm -e --nodeps php

and install the other version with:

rpm -i php-full-file-name.rpm
0
 
alexmdbeAuthor Commented:
Complete novice here

How do i "First get the rpm for the version of PHP that you wish to install"

thanks

Alex md @ be
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
jlevieCommented:
Doing a bit more looking the version of PHP in the current version of CentOS (5.5) is php-5.1.6-27. I suspect that you are wanting to revert to the version of PHP that was in CentOS 5.2. In which case you would get the rpm from the CentOS 5.2 distribution media.

In most cases with CentOS, changes to packages will be bug fixes and not change the package in such a way as to cause problems. Why do you think you need the earlier version?
0
 
alexmdbeAuthor Commented:
We have deployed a server with Joomla 1.5, there was a bit of confusion to which version of php that was needed and whilst Joomla 1.5 supports PHP 5.3, a particular solution we have integrated does not.

This is why we need to revert back from PHP 5.3 back to 5.2.

 Centos is currently the 32bit mode,

I have your instructions as below:

"rpm -e --nodeps php

and install the other version with:

rpm -i php-full-file-name.rpm"

but where exactly do i need obtain an earlier version, and is there any steps needed to install this onto centos before running the above commands.

regards

Alex md @ be

0
 
jlevieCommented:
Check what version of PHP you have by executing:

rpm -q php

and post the results.
0
 
alexmdbeAuthor Commented:

jlevie:

php-5.3.5-1.el5.remi.1

cheers

Alex md @ be
0
 
jlevieCommented:
Okay so you don't have the CentOS version of PHP and have done an "Out of band" update of PHP from a source other than the CentOS packages. Check to see if any non-CentOS repositories are in /etc/yum.repos.d and disable any other than the CentOS repositories. Then do:

yum remove php
yum install php

The will result in php-5.1.6-27.el5_5.3 being installed.
0
 
alexmdbeAuthor Commented:
is there a way I can backup first just to revert back in case something goes wrong?
0
 
jlevieCommented:
I doubt anything will go wrong, but you could back up the system before fiddling with it.
0
 
alexmdbeAuthor Commented:
how? (again complete novice)
0
 
alexmdbeAuthor Commented:
jlevie

forget the backup bit just need a step by step on the

/etc/yum.repos.d and disable any other than the CentOS repositories.

& further to add completely mucked up it is acutaly centos 5.5 not 5.2 (sorry for the mixup)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.