Solved

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

Posted on 2011-03-17
12
919 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
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

803 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