The right PHP version is essential for the performance and security of your website. In this guide, we explain how to change the PHP version in DirectAdmin.

Why PHP Version is Important

PHP is the programming language that powers most websites, including WordPress, WooCommerce, and other CMS systems. Newer PHP versions offer:

Benefits of New PHP Versions

  • Speed: PHP 8.x is up to 3x faster than PHP 7.x
  • Security: Older versions no longer receive security updates
  • Compatibility: New plugins and themes often require PHP 8+
  • Functionality: New features and improvements

PHP Version Lifecycle

Version Status End of Support
PHP 7.4 End of Life December 2022
PHP 8.0 End of Life November 2023
PHP 8.1 Active November 2024
PHP 8.2 Active December 2025
PHP 8.3 Current December 2026

Recommendation: Use at least PHP 8.1, preferably PHP 8.2 or 8.3.

Checking PHP Version

In WordPress

  1. Go to ToolsSite Health
  2. Click on Info
  3. Look for ServerPHP Version

Via DirectAdmin

  1. Log in to DirectAdmin
  2. Go to PHP Settings or Domain Setup
  3. You will see the current PHP version

Via PHP File

Upload a file phpinfo.php with:

<?php phpinfo(); ?>

Open this in your browser and look for "PHP Version".

Delete this file after checking! (security risk)

Changing PHP Version

Method 1: Via Domain Setup

  1. Log in to DirectAdmin
  2. Go to Domain Setup or Website Settings
  3. Click on your domain
  4. Look for PHP Version Selector or PHP Version
  5. Select the desired version (e.g., PHP 8.2)
  6. Click on Save

Method 2: Via PHP Settings

  1. Log in to DirectAdmin
  2. Go to PHP Settings or PHP Configuration
  3. Select your domain (if you have multiple)
  4. Choose the PHP version from the dropdown menu
  5. Click on Apply

Method 3: Per Subdomain

You can use different PHP versions per subdomain:

  1. Go to Subdomain Management
  2. Click on the subdomain
  3. Change the PHP version specifically for that subdomain
  4. Click on Save

Before the Change: Check Compatibility

WordPress Compatibility

  1. Update WordPress to the latest version
  2. Update all plugins and themes
  3. Check the plugin descriptions for PHP requirements
  4. Make a backup before changing

Common Compatibility Issues

Deprecated Functions:

  • mysql_* functions no longer work (use mysqli_* or PDO)
  • ereg_* functions have been removed (use preg_*)
  • each() function has been removed in PHP 8

Strict Types: PHP 8 is stricter with types. This can cause errors in older code.

After the Change

Testing the Website

  1. Open your website in the browser
  2. Test all pages
  3. Check forms
  4. Test the shopping cart (if you have an online store)
  5. Check the admin/backend

Common Problems

White Screen of Death:

  • PHP error - check the error logs
  • Incompatible plugin - deactivate plugins one by one
  • Theme issue - switch to the default theme

500 Internal Server Error:

  • Syntax error in code
  • Incorrect .htaccess configuration
  • PHP memory limit reached

Plugin/Theme Not Working:

  • Update to the latest version
  • Look for an alternative
  • Contact the developer

Adjusting PHP Settings

In addition to the version, you can also change PHP settings:

Increasing Memory Limit

  1. Go to PHP Settings in DirectAdmin
  2. Look for memory_limit
  3. Increase to 256M or 512M
  4. Click on Save

Increasing Upload Limit

  1. Go to PHP Settings
  2. Change upload_max_filesize (e.g., 64M)
  3. Change post_max_size (a bit higher, e.g., 68M)
  4. Click on Save

Increasing Execution Time

For longer processes:

  1. Go to PHP Settings
  2. Change max_execution_time (e.g., 300)
  3. Click on Save

Rolling Back to an Older Version

If your website does not work after the upgrade:

  1. Go back to PHP Settings or Domain Setup
  2. Select the previous PHP version
  3. Click on Save
  4. Test your website

This is a temporary solution. Plan to update your code for compatibility with newer PHP versions.

Tips for PHP Updates

  1. Test Locally First: Test in a staging environment before production
  2. Always Make a Backup: Database and files
  3. Update Gradually: Don’t jump from 7.4 to 8.3, but go through 8.1
  4. Check Error Logs: Check logs after changing
  5. Keep Plugins Up-to-Date: Outdated plugins are often the cause of issues

Need Help?

We are here for you! Are you facing any issues or have questions? Our support team is happy to assist you personally. Send us a message via the ticket system - we usually respond within a few hours and are happy to help.