Search Our Database

How to upgrade php version from 5.2 to 5.3 on DirectAdmin platform

Last updated on |

Introduction

Upgrading PHP on a dedicated server running the DirectAdmin platform is an essential task for maintaining security, improving performance, and ensuring compatibility with modern applications. PHP 5.2, while popular in its time, has been deprecated and no longer receives security updates, making it vulnerable to exploits. Therefore, upgrading to PHP 5.3, which introduced several new features and bug fixes, is highly recommended for users running legacy applications.

This guide explains how to upgrade PHP from version 5.2 to 5.3 on a DirectAdmin-based server. The step-by-step process is specifically tailored for system administrators managing dedicated servers. Upgrading PHP is crucial to keep up with security patches and to maintain compatibility with modern web applications. However, care should be taken to ensure that existing applications remain compatible with the upgraded PHP version, as PHP 5.3 introduced new features and changes that might affect older applications.

Important Note: PHP 5.x versions, including 5.3, have reached their end-of-life (EOL) and no longer receive security updates or patches. It is highly recommended to upgrade to a supported PHP version (such as PHP 7.x or PHP 8.x) to avoid potential security risks.

 

Prerequisites

  • SSH access to the dedicated server.
  • DirectAdmin custombuild version installed.
  • Administrative privileges on the server.
  • Backups of all critical data and applications in case of any issues after the upgrade.
  • Familiarity with SSH commands and basic server management.

 

Step-by-step Guide

Step 1: Access the Server via SSH

First, establish a connection to your dedicated server using SSH. Open a terminal or use an SSH client like PuTTY and enter the following command:

ssh root@your-server-ip

 

Replace your-server-ip with your server’s actual IP address. You’ll need to log in with root privileges.

Step 2: Navigate to the DirectAdmin CustomBuild Directory

Once you’re logged in to the server, navigate to the custombuild directory where DirectAdmin manages its build scripts:

cd /usr/local/DirectAdmin/custombuild

 

Step 3: Set PHP Version to 5.3

Run the following command to configure DirectAdmin to use PHP 5.3:

./build set php5_ver 5.3

 

Step 4: Update the CustomBuild Script

Next, update the custombuild script to ensure you have the latest version:

./build update

 

Step 5: Rebuild PHP

After updating the script, rebuild PHP to complete the upgrade:

./build php n

 

Step 6: Restart Apache

Once PHP has been rebuilt, restart the Apache web server to apply the changes:

service httpd restart

 

Step 7: Verify the PHP Upgrade

To confirm that PHP has been successfully upgraded, check the version by running the following command:

php -v

 

The output should display the newly installed PHP version. An example output may look like this:

PHP 5.3.13 (cli) (built: Jun 12 2012 19:37:45)

 

Conclusion

Following these steps, you will have successfully upgraded PHP from version 5.2 to 5.3 on your DirectAdmin-based server. It’s important to remember that PHP 5.x versions, including 5.3, are no longer supported. Therefore, upgrading to a later version, such as PHP 7.x or PHP 8.x, is highly recommended to avoid security vulnerabilities and benefit from modern features.

For additional assistance or if you encounter any issues, please contact our support team at support@ipserverone.com.