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

Why PHP version matters

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 Outdated December 2022
PHP 8.0 Outdated 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 Info
  3. Look for ServerPHP version

Via DirectAdmin

  1. Log in to DirectAdmin
  2. Go to PHP Settings or Domain Setup
  3. You'll 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. Find PHP Version Selector or PHP version
  5. Select the desired version (e.g., PHP 8.2)
  6. Click 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 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 Save

Before changing: Check compatibility

WordPress compatibility

  1. Update WordPress to the latest version
  2. Update all plugins and themes
  3. Check 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 are removed (use preg_*)
  • each() function is removed in PHP 8

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

After changing

Test website

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

Common problems

White page (White Screen of Death):

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

500 Internal Server Error:

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

Plugin/theme not working:

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

Adjusting PHP settings

Besides the version, you can also change PHP settings:

Increase memory limit

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

Increase upload limit

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

Increase execution time

For longer processes:

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

Rolling back to old version

If your website doesn't work after the upgrade:

  1. Go back to PHP Settings or Domain Setup
  2. Select the previous PHP version
  3. Click 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 on 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, go via 8.1
  4. Check error logs: Check logs after changing
  5. Keep plugins up-to-date: Outdated plugins are often the cause of problems

Need help?

We're here for you! Running into issues or have questions? Our support team is happy to help you personally. Drop us a message through the ticket system - we usually respond within a few hours and love helping you find the best solution.