How to Change PHP Version on DirectAdmin Hosting

Updated: October 8, 2026 · 8 min read · Category: Hosting

How to Change PHP Version on DirectAdmin Hosting

Table of Contents

  1. Why Change PHP Version?
  2. Comparing PHP Versions
  3. Changing PHP via DirectAdmin
  4. Changing PHP via .htaccess
  5. Verifying Your PHP Version
  6. Essential PHP Extensions
  7. Troubleshooting After PHP Change
  8. PHP Version for WordPress
  9. Frequently Asked Questions

1. Why Change PHP Version?

PHP powers over 80% of websites worldwide, including WordPress, Joomla, and Drupal. Each PHP version has a defined End of Life (EOL) date. Once a version reaches EOL, it no longer receives security patches, leaving your site vulnerable to attacks.

Key reasons to change PHP version:

PHP in 2026: PHP 8.2 and 8.3 are the recommended versions for new projects. PHP 7.4 reached End of Life at the end of 2022.

2. Comparing PHP Versions

Overview of PHP versions commonly found on hosting:

VersionStatusSecurity SupportRecommendation
PHP 7.4End of LifeEnded (Dec 2022)Not recommended — legacy use only
PHP 8.0End of LifeEnded (Nov 2023)Not recommended
PHP 8.1Security Fix OnlyDec 2025Acceptable — good for older WP
PHP 8.2Active SupportDec 2026Recommended — stable
PHP 8.3Active SupportNov 2027Recommended — latest

AsiaGB Hosting supports PHP 7.4, 8.0, 8.1, 8.2, and 8.3. You can switch versions instantly through DirectAdmin without contacting support.

3. Changing PHP via DirectAdmin

DirectAdmin includes a PHP Version Selector for easy version management. Follow these steps:

  1. Log in to DirectAdmin at yourdomain.com:2222 or the URL provided
  2. Navigate to Advanced Features or Software
  3. Click PHP Version Selector or PHP Selector
  4. Select the domain to modify (if you have multiple domains)
  5. Choose your desired PHP version from the dropdown
  6. Click Save or Apply
  7. Wait a moment, then refresh your website

Note: PHP version changes take effect immediately without a server restart. Per-domain PHP Selector allows different PHP versions for each domain on the same account.

If you can't find the PHP Version Selector

If the menu isn't visible in DirectAdmin, try these alternative locations:

If still not found, contact AsiaGB support via Ticket to request a PHP version change.

4. Changing PHP via .htaccess

You can also specify PHP version for a specific directory using .htaccess:

# Change PHP for this directory only
AddHandler application/x-httpd-php82 .php
# Or using fcgi
AddHandler fcgid-script .php
FCGIWrapper /usr/local/bin/php82-cgi .php

Warning: The .htaccess syntax for PHP may vary depending on server configuration. If this doesn't work, contact support to confirm the correct handler.

Using the DirectAdmin PHP Selector is generally preferred as it's more reliable and works with all server configurations.

5. Verifying Your PHP Version

After changing PHP, always verify the correct version is active:

Method 1: phpinfo()

<?php
// Create info.php — delete it after checking!
phpinfo();
?>

Method 2: PHP CLI

php -v

Method 3: WordPress Health Check

In WordPress Admin → Tools → Site Health → Info → Server, the current PHP version is displayed.

Important: Delete info.php immediately after checking. The phpinfo() output reveals server configuration details that could assist attackers.

6. Essential PHP Extensions

Key extensions required for WordPress and general web applications:

ExtensionPurposeWordPress
curlHTTP requests, API callsRequired
gd / imagickImage processing, thumbnailsRequired
mbstringMultibyte strings (Thai, Chinese)Required
mysqli / pdo_mysqlMySQL databaseRequired
opensslSSL/TLS, encryptionRequired
xml / xmlreaderXML parsing, RSSRequired
zipArchive, plugin installationRequired
opcachePHP code cachingHighly recommended
intlInternationalizationRecommended
sodiumCryptography (WP 5.2+)Recommended

In DirectAdmin, extensions can be managed via PHP Selector → Extensions. Some hosting plans may limit which extensions can be modified.

7. Troubleshooting After PHP Change

Common issues after changing PHP version and how to resolve them:

White Screen or 500 Error

Usually caused by a plugin or theme incompatible with the new PHP version:

  1. Switch back to the previous PHP version temporarily
  2. Check the PHP error log in DirectAdmin → Files → Log Viewer
  3. Deactivate plugins one by one to identify the problematic one
  4. Update all plugins and themes to the latest version before upgrading PHP

Functions or Features Not Working

PHP 8.x removed or changed behavior of some PHP 7.x functions:

Database Connection Error

Verify that the new PHP version has the mysqli or pdo_mysql extension enabled. Check via phpinfo() or DirectAdmin PHP Extensions.

Sessions or Cookies Not Working

Check session.save_path in php.ini and the permissions of the session storage directory.

8. PHP Version for WordPress

WordPress recommends these PHP versions based on current releases:

WordPress VersionRecommended PHPMinimum PHP
WordPress 6.4+PHP 8.2 or 8.3PHP 7.4
WordPress 6.0–6.3PHP 8.1 or 8.2PHP 7.4
WordPress 5.xPHP 8.0 or 8.1PHP 7.4

Steps to Upgrade PHP for WordPress

  1. Backup — Always back up both database and files first
  2. Check plugin compatibility — Review plugin pages for tested PHP version
  3. Update WordPress, plugins, themes — Update everything to the latest versions first
  4. Test on staging — If you have a staging environment, test there first
  5. Change PHP on production — Via DirectAdmin PHP Selector
  6. Test the site — Check all key pages, forms, and features

Tip: AsiaGB Hosting includes Softaculous with automatic backup functionality. Use it to create a backup before changing PHP. AsiaGB also provides twice-monthly automated backups (1st and 15th of each month).

9. Frequently Asked Questions (FAQ)

How do I change PHP version in DirectAdmin?
Log in to DirectAdmin, go to Software or Advanced Features, click PHP Version Selector, choose your domain, select the desired PHP version, and click Save. Changes take effect immediately.
Which PHP version is best for WordPress?
WordPress 6.x supports PHP 7.4 and above. PHP 8.1 or 8.2 is recommended for best performance. Always check plugin compatibility before upgrading.
My site broke after changing PHP, what should I do?
Switch back to the previous PHP version first, then check the PHP error log in DirectAdmin to identify the cause before attempting to upgrade again.
What PHP extensions are required for WordPress?
Required extensions include curl, gd, mbstring, mysqli, openssl, xml, and zip. Most are enabled by default on quality hosting providers.
Which PHP versions does AsiaGB Hosting support?
AsiaGB Hosting supports PHP 7.4, 8.0, 8.1, 8.2, and 8.3. You can change the version yourself through DirectAdmin without contacting support.
Can I set different PHP versions per subdomain or folder?
Yes, using .htaccess directives in that directory, or via DirectAdmin PHP Selector with per-domain configuration on supported hosting plans.

Summary

Changing PHP version on DirectAdmin Hosting is quick and easy via the PHP Selector. Upgrading to PHP 8.2 or 8.3 delivers better security and performance. Always back up your site first, and test thoroughly after the change. If you encounter issues, AsiaGB's support team is available 24/7 via Ticket to help.