Page 1 of 1

Downgrade from PHP 5.3 to 5.2 without breaking Plesk

Posted: Mon Jun 13, 2011 5:00 am
by chrismcb
Hi,

I (blindly) updated PHP to 5.3 without checking changelogs and newly deprecated features - causing a few sites on my Plesk managed CentOS box to behave slightly strange.

I'm looking for some advice on the best and cleanest way to downgrade to 5.2.


I have tried:

Code: Select all

yum downgrade php
With the allowdowngrade plugin for Yum, but it gives errors:

Code: Select all

Transaction Check Error:
  file /usr/bin/phar.phar from install of php-cli-5.3.6-2.el5.art.i386 conflicts with file from package php-cli-5.3.6-3.el5.art.x86_64
  file /usr/bin/phpize from install of php-cli-5.3.6-2.el5.art.i386 conflicts with file from package php-cli-5.3.6-3.el5.art.x86_64
I'd rather not "tinker" with this - as it is a live system and hope that someone can offer advice on the correct way to do it?



Thanks

Re: Downgrade from PHP 5.3 to 5.2 without breaking Plesk

Posted: Mon Jun 13, 2011 5:25 am
by chrismcb
Apologies, I eventually found a similar thread on the forum.

http://www.atomicorp.com/forums/viewtop ... f=2&t=4902

After reading between the lines, I eventually downgraded by performing the following steps:
  1. Go to the ART repository for your system (mine was: http://www6.atomicorp.com/channels/atom ... 6_64/RPMS/)
  2. Download the version of PHP you want to install into a new directory on the server using wget
  3. Run the command

    Code: Select all

    rpm --oldpackage -Uvh php*
    (which gave me some dependency errors)
  4. Download all the packages that the errors list from the ART repository, in my case:
    • php-5.2.17-1.el5.art.x86_64.rpm
    • php-cli-5.2.17-1.el5.art.x86_64.rpm
    • php-common-5.2.17-1.el5.art.x86_64.rpm
    • php-devel-5.2.17-1.el5.art.x86_64.rpm
    • php-gd-5.2.17-1.el5.art.x86_64.rpm
    • php-imap-5.2.17-1.el5.art.x86_64.rpm
    • php-mbstring-5.2.17-1.el5.art.x86_64.rpm
    • php-mysql-5.2.17-1.el5.art.x86_64.rpm
    • php-pdo-5.2.17-1.el5.art.x86_64.rpm
    • php-xml-5.2.17-1.el5.art.x86_64.rpm
  5. Keep running the command

    Code: Select all

    rpm --oldpackage -Uvh php*
    , until it accepts it and reverts back with success
  6. Restart Apache with

    Code: Select all

    /sbin/service httpd restart
  7. Check your PHP version with

    Code: Select all

    php -v
    • Mine is now:

      Code: Select all

      PHP 5.2.17 (cli) (built: Jan  7 2011 10:39:29)
      Copyright (c) 1997-2010 The PHP Group
      
  8. Set yum to ignore PHP updates by editing /etc/yum.conf and including the line:

    Code: Select all

    exclude=php*

Hope that helps someone!

Re: Downgrade from PHP 5.3 to 5.2 without breaking Plesk

Posted: Fri Jul 01, 2011 5:03 pm
by dopesheet
I cannot thank you enough for these clear instructions. I have been working on this for almost 24 hours straight and your post finally got me up and running again.

I did things slightly differently to get it to actually work, but your steps helped me to get there.

Code: Select all

wget http://www6.atomicorp.com/channels/atomic/centos/5/x86_64/RPMS/php-5.2.17-1.el5.art.i386.rpm
yum downgrade php*
at the end, under Transaction Summary, I took note of everything it said would need to be removed because of dependencies and used wget to grab those packages. Eventually your transaction summary should say to remove 0 packages and reinstall 0 packages, and downgrade several packages, for me it was

php
php-cli
php-common
php-devel
php-gd
php-imap
php-mbstring
php-mysql
php-pdo
php-pgsql
php-xml

At this point I said yes to the downgrade and it went through and did its thing. Then apache stopped working and I was getting PHP Fatal errors regarding the ioncube loader, the zendguard loader, and loading zend optimizer more than once.

I had to go into the php.d and I commented out everything in

ioncube.ini
zend.ini
zendguard.ini

I then copied the original contents of ioncube.ini and copied that line to load before zend in your etc/php.ini file

Code: Select all

zend_extension=/usr/lib64/php/ioncube/ioncube_loader_lin_5.2.so
[Zend]
zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.3.3
zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.3.3
zend_optimizer.version=3.3.3
zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so
zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
finally I started apache up with success and everything seems to be in order so far

Re: Downgrade from PHP 5.3 to 5.2 without breaking Plesk

Posted: Mon Jul 04, 2011 7:02 am
by breun
Please know that PHP 5.2 is no longer supported and there won't be any PHP 5.2.x (security) updates.

Re: Downgrade from PHP 5.3 to 5.2 without breaking Plesk

Posted: Mon Sep 19, 2011 6:17 am
by ethanehunt
I am trying to do the same thing. I upgraded mysql and php to latest version, then realized zend guard loader will not load my files encoded for zend optimizer. I tried "yum downgrade php*" two times and it did downgrade my php, but it also made apache stop running and I could not start it until I upgraded back to newer php version.

Re: Downgrade from PHP 5.3 to 5.2 without breaking Plesk

Posted: Tue Sep 27, 2011 5:36 pm
by hostingguy
whats with the shameless spam posting for ged?