(dv) 4.0:Downgrade PHP

  • This page was last modified on August 19, 2011, at 15:57.
The (mt) Community Wiki is a collaborative project. Any (mt) Media Temple customer or employee may contribute. Not all articles and/or content have been tested for accuracy by (mt) Media Temple.

For officially moderated and tested articles, be sure to visit our KnowledgeBase.

From (mt) Community Wiki

Contents

Many customers have asked about how to downgrade the version of PHP on their server, as their apps don't support PHP 5.3. This guide will go over how to get PHP 5.2.17 installed and PHP 5.3.x removed.

Results

Your server will now have PHP 5.2.17 (or greater) installed.

Please note that this article goes over making significant changes to your server, so we recommend making backups before upgrading. Also note that this is outside of (mt) Media Temple's Scope of Support http://mediatemple.net/support/statement.php#dv.

Requirements

This article has the following dependencies:

root access enabled: http://wiki.mediatemple.net/w/(dv):Enable_root_access
Developer Tools installed: http://wiki.mediatemple.net/w/(dv):Install_the_Developer_Tools
The Rusia repository installed from http://wiki.mediatemple.net/w/(dv):Upgrade_software_with_YUM#Instructions (Make sure you use the x86_64 link instead of i386)

Instructions

1. Connect to your server via SSH as root.

2. Once logged in, use the following command:

rpm -e --nodeps php-devel php php-cli php-common php-mcrypt php-mysql php-pdo php-ldap php-mbstring php-xml php-xmlrpc php-odbc php-imap php-snmp php-gd

3. This will completely remove PHP 5.3.x, as well as all the associated modules from your server.

4. Next type the following command:

yum install php-devel php php-cli php-common php-mcrypt php-mysql php-pdo php-ldap php-mbstring php-xml php-xmlrpc php-odbc php-imap php-snmp php-gd

5. This will now install PHP 5.2.17 on your server. However, Apache will still see the old PHP version. To fix this type the following command:

service httpd restart