Search Our Database

How to Downgrade PHP 5.3 to PHP 5.2 on DirectAdmin

Last updated on |

Introduction

In some cases, downgrading PHP may be necessary to maintain compatibility with older applications. If you are managing a Dedicated Server on the DirectAdmin platform, downgrading PHP from version 5.3 to 5.2 can be done through SSH. This guide explains the step-by-step process to perform the downgrade and ensure the server operates with the older version of PHP.

Warning: PHP 5.2 and PHP.5.3 is no longer supported and has reached End-of-Life (EOL). Using outdated versions of PHP poses security risks and may expose your server to vulnerabilities. It is highly recommended to upgrade to a supported PHP version as soon as possible.

 

Prerequisites

Ensure the following before proceeding:

  • SSH access to your dedicated server.
  • DirectAdmin is installed and accessible.

 

Step-by-step Guide

Step 1: SSH into Your Server

Access your server through SSH using a terminal or command-line interface. Enter the correct credentials to log in.

 

Step 2: Execute the Downgrade Commands

Once logged in, enter the following commands in sequence to initiate the downgrade:

cd /usr/local/DirectAdmin/custombuild
./build set php5_ver 5.2
./build update
./build php n
service httpd restart

 

Step 3: Verify the PHP Version

After the process completes, verify the current PHP version by entering the following command:

php -v

This will display the installed PHP version, which should show something similar to:

PHP 5.2.17 (cli) (built: Mar 6 2012 18:10:46)

 

Conclusion

By following the steps in this guide, you have successfully downgraded PHP from version 5.3 to 5.2 on your DirectAdmin server. Ensure that your applications are now running as expected with the downgraded PHP version. Always test thoroughly after downgrading to avoid compatibility issues.

Should you have any inquiries about the guidelines, please feel free to open a ticket through your portal account or contact us at support@ipserverone.com. We’ll be happy to assist you further.

 

Article posted on 20 April 2020 by Louis