1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Cannot downgrade PHP 5.3 > 5.2

Discussion in 'Plesk 10.x for Linux Issues, Fixes, How-To' started by FirstPoint, Aug 31, 2011.

  1. FirstPoint

    FirstPoint Basic Pleskian

    17
    85%
    Joined:
    Feb 8, 2011
    Messages:
    37
    Likes Received:
    0
    Hi all,

    We've accidentaly migrated from PHP 5.2 to PHP 5.2 with the autoinstaller.

    We cannot stay on PHP 5.3 for the moment as too much functions that our customers use are deprecated.

    We've tried downgrading via the autoinstaller but we get the following error:
    We've searched the forums and found some threads where it was advised to install manually via Atomic, but this is not a standard for parallels and our Plesk provider strictly does not allow that, or we would take the risk of not having their support anymore... What to do ?

    Thanks for your help !
     
  2. vincenzot

    vincenzot Regular Pleskian

    22
    40%
    Joined:
    Jul 3, 2009
    Messages:
    104
    Likes Received:
    0
    Try to remove all php.5-3 packages and psa-php53-configurator and install again php 5.2 from the panel.
     
  3. FirstPoint

    FirstPoint Basic Pleskian

    17
    85%
    Joined:
    Feb 8, 2011
    Messages:
    37
    Likes Received:
    0
    We've already tried doing that a few days ago and Plesk was a direct dependency of PHP53 so it completely uninstalled Plesk... and we had to fix everything manually to get Plesk back on the road...
     
  4. Webroy

    Webroy Regular Pleskian

    26
    23%
    Joined:
    Oct 29, 2008
    Messages:
    156
    Likes Received:
    0
    Wil this help?:

    #yum install yum-allowdowngrade

    Now add a line to your yum.conf file, its located in /etc/yum.conf
    #vi /etc/yum.conf
    showdupesfromrepos=1


    After that list all php packages:

    yum list php

    If php 5.2.8 is available, remove new one:

    yum remove php

    and install an old one:

    yum --allow-downgrade install php-5.2.8
     
  5. FirstPoint

    FirstPoint Basic Pleskian

    17
    85%
    Joined:
    Feb 8, 2011
    Messages:
    37
    Likes Received:
    0
    Hi.

    I had tried that yesterday also. But when I typed yum remove php it would also remove dependencies, and Plesk because it is directly dependent to PHP. So I didn't go ahead.

    But I tried again this morning and now, very wired, when typing yum remove php I get: No Match for argument: php. Incredible, since we do have PHP running on the websites ! I tried yum clean all but doesn't fix anything.

    By the way, when I do yum list php I don't have php-5.2.8 but only the following:
     
  6. vincenzot

    vincenzot Regular Pleskian

    22
    40%
    Joined:
    Jul 3, 2009
    Messages:
    104
    Likes Received:
    0
    Try that:

    The output in my test server is that (ufficial packaged of centos):

    After that do

    Now you have remove all php53 packaged and I think you can switch again to php52 (i'm not responsable of that, use it at your own risk)
     
  7. GothicJB

    GothicJB New Pleskian

    13
    35%
    Joined:
    Sep 16, 2011
    Messages:
    17
    Likes Received:
    0
    Location:
    Blaine, MN
    Howto upgrade to php53u with plesk

    I was pointed to this thread by parallels as a solution for "plesk not recognizing my upgrade to php53 from the IUS Repository (php53u)" ... this was NOT helpful at all so I'm posting my workaround and temporary fix until parallels can come up with something better. Their solution was to DOWNGRADE php on my production server which left a large number of my customers with broken sites!

    However - here is the workaround for installing/upgrading php to the IUS Repository version php53u:

    *Prerequisite: make sure you have enable php53 support and upgraded php to 5.3 in plesk
    1) remove php53 packages without removing dependencies (plesk)
    a) rpm -qa |grep php
    b) copy /etc/php.ini to safe location
    c) rpm -e --nodeps (list of php packages from the above command - with the exception of "psa-php53-configurator")
    2) install IUS Repository for YUM
    a) wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-8.ius.el5.noarch.rpm
    b) wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-5-4.noarch.rpm
    c) rpm -Uvh ius-release*.rpm epel-release*.rpm
    3) install php53u from the IUS Repository
    a) yum install list of packages from [1.a] changing the php53 to php53u
    b) copy saved php.ini file to /etc/php.ini
    c) /etc/init.d/httpd restart
    *At this point php should be successfully upgraded. However, plesk will not see it as an installed component.
    *The fix for this at the moment is:

    1) install the following script:
    <BEGIN BASH SCRIPT>
    #!/bin/bash
    MYSQLPASS=$(cat /etc/psa/.psa.shadow)

    mysql -Ns -uadmin -p$MYSQLPASS -Dpsa -e 'update Components set version="5.3.8-2.ius.el5" where name="php" limit 1;'
    <END BASH SCRIPT>

    *MAKE SURE TO CHANGE "VERSION" TO WHATEVER THE CURRENT VERSION YOU INSTALLED IS!
    *Create a crontab to run this script every 5/10/15/30 minutes (whatever you think is reasonable)

    This is a temporary fix that will register the new php version as a component in the plesk. The reason for the cronjob is because whenever plesk restarts or you refresh the component list or upgrade/install anything via the plesk installer, the DB field for php version will be overwritten and plesk will no longer see php as an installed component.

    Hope this helps out someone. Let me know if you need any more info or if this is not clear.
     
    Last edited: Oct 14, 2011
  8. blafasel

    blafasel Guest

    0
     
    another fix

    Thanks a lot. I've made a little modification to your script in order to not having to bother with PHP-Updates.

    Code:
    #!/bin/bash
    MYSQLPASS=$(cat /etc/psa/.psa.shadow)
    PHP=$(rpm -q php53u | sed 's/php53u-//g;s/.x86_64//g')
    mysql -Ns -uadmin -p$MYSQLPASS -Dpsa -e'update Components set version="'$PHP'" where name="php" limit 1;'
    
    exchange .x86_64 for .i686 if you are on a 32-bit system.
     
Loading...