Solved

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

Posted on 2011-03-17
12
916 Views
Last Modified: 2013-12-13
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
0
Comment
Question by:alexmdbe
  • 6
  • 6
12 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 35160677
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
 

Author Comment

by:alexmdbe
ID: 35160738
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
 
LVL 40

Expert Comment

by:jlevie
ID: 35161896
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
 

Author Comment

by:alexmdbe
ID: 35164177
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
 
LVL 40

Expert Comment

by:jlevie
ID: 35165255
Check what version of PHP you have by executing:

rpm -q php

and post the results.
0
 

Author Comment

by:alexmdbe
ID: 35165590

jlevie:

php-5.3.5-1.el5.remi.1

cheers

Alex md @ be
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 40

Expert Comment

by:jlevie
ID: 35166129
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
 

Author Comment

by:alexmdbe
ID: 35166262
is there a way I can backup first just to revert back in case something goes wrong?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 35166454
I doubt anything will go wrong, but you could back up the system before fiddling with it.
0
 

Author Comment

by:alexmdbe
ID: 35166507
how? (again complete novice)
0
 

Author Comment

by:alexmdbe
ID: 35166665
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
 
LVL 40

Accepted Solution

by:
jlevie earned 450 total points
ID: 35167272
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

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now