How to downgrade PHP 5.3 on CentOS 5.x/6.x

Created:

2016-11-16 13:17:21 UTC

Modified:

2017-04-24 11:34:10 UTC

0

Was this article helpful?


Have more questions?

Submit a request

How to downgrade PHP 5.3 on CentOS 5.x/6.x

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 10.4 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Linux

Problem

Some PHP applications running on websites are not compatible with PHP 5.3 and it may be necessary to downgrade PHP on the server.

Resolution

On CentOS 5 : PHP 5.3.x is provided by Odin, while PHP 5.1.x is available from the OS vendor's repositories.

The steps to downgrade are as follows:

  1. Since PHP 5.3 packages have the name "php53" or "php53-mysql," they cannot be replaced by the vendor's PHP packages and should be removed, ignoring dependencies:

    rpm -qa | grep php53 | xargs rpm -e --nodeps
  2. Install PHP from the vendor's repositories:

    yum install php php-pdo php-gd php-imap php-mbstring php-mysql php-xml php-cli
  3. Download the Plesk psa-php5-configurator package appropriate for your Plesk version and server CPU architecture:

  4. Plesk 10.4.4 on CentOS 5 i386

  5. Plesk 10.4.4 on CentOS 5 x86_64
  6. Plesk 11.0.9 on CentOS 5 i386
  7. Plesk 11.0.9 on CentOS 5 x86_64

  8. Install the Plesk PHP configurator package:

    rpm -Uhv psa-php5-configurator-1.6.2-cos5.build110120608.16.x86_64.rpm

On CentOS 6 : CentOS 6 shipped with PHP 5.3 from the beginning and there are no earlier versions available in the OS vendor's repositories. A third-party software repository can be used. For example, PHP 5.2.17 is available from the Atomic repository . However, to downgrade PHP and keep it, automatic Plesk updates should be disabled. Micro-Updates should be installed as recommended in KB #213943585 .

Steps to downgrade PHP on CentOS 6:

  1. Add Atomic repository:

    wget -qq -O - http://www.atomicorp.com/installers/atomic | /bin/bash
  2. Downgrade all PHP packages:

    yum downgrade $(rpm -qa --qf "%{NAME}" | grep -v ioncube | grep ^php | awk '{print $1"-5.2.17"}')
Have more questions? Submit a request

2 Comments

  • 0
    Avatar
    Byoung-Jin Yu

    Hello!

    This is what i am finding exactly!

    but has some problem.

    I've tried on CentOS6.8.

    Second command shows Error.

    =====

    Error: Need to pass a list of pkgs to downgrade

    Usage: yum [options] COMMAND

    =====

    i cant find what's wrong with it.

     

     

     

    Edited by Byoung-Jin Yu
  • 0
    Avatar
    Anton Maslov

    Hi, that was a syntax error, fixed that now, please check.

Please sign in to leave a comment.