Hosting September 15, 2026 8 min read

How to Change PHP Version on DirectAdmin Hosting

How to Change PHP Version on DirectAdmin Hosting

Choosing the right PHP version on DirectAdmin hosting is critical for websites running WordPress, Joomla, Laravel, or any PHP-based application. Different PHP versions offer varying levels of performance, security, and compatibility.

This guide walks you through changing PHP version on DirectAdmin step by step, compares available versions, and answers common questions.

Table of Contents

  1. Supported PHP Versions on DirectAdmin
  2. Why Upgrade Your PHP Version?
  3. How to Check Your Current PHP Version
  4. Step-by-Step: Changing PHP Version in DirectAdmin
  5. Setting PHP Version via .htaccess
  6. Setting Different PHP Versions Per Domain
  7. PHP Version Comparison Table
  8. Best PHP Version for WordPress
  9. Troubleshooting After PHP Version Change
  10. Frequently Asked Questions
  11. Summary

Supported PHP Versions on DirectAdmin

Hosting environments using DirectAdmin typically support multiple PHP versions simultaneously through MultiPHP or PHP Selector, allowing users to choose the version they need without affecting other accounts.

AsiaGB Hosting supports the following PHP versions:

💡 Tip For new websites or the latest WordPress installations, use PHP 8.2 or 8.3 for the best performance and security.

Why Upgrade Your PHP Version?

There are several compelling reasons to upgrade your PHP version:

How to Check Your Current PHP Version

Before making changes, verify your current PHP version using one of these methods:

Method 1: Through DirectAdmin Panel

  1. Log in to your DirectAdmin panel
  2. Navigate to Extra Features → PHP Selector or Select PHP Version
  3. Your current PHP version will be displayed

Method 2: Create a phpinfo.php file

Create a file named phpinfo.php in your public_html folder with this content:

<?php phpinfo(); ?>

Open https://yourdomain.com/phpinfo.php in your browser to see complete PHP configuration. Always delete this file immediately after use.

⚠️ Warning Delete phpinfo.php immediately after checking. This file exposes your entire server configuration, which is a security risk.

Step-by-Step: Changing PHP Version in DirectAdmin

Follow these steps to change your PHP version in DirectAdmin:

  1. Log in to DirectAdmin
    Open your browser and go to your DirectAdmin URL, such as https://ns1.yourdomain.com:2222. Log in with your hosting username and password.
  2. Go to Extra Features
    On the DirectAdmin dashboard, find the Extra Features or Advanced Features section.
  3. Click PHP Selector or Select PHP Version
    You'll see a list of available PHP versions (e.g., PHP 7.4, 8.0, 8.1, 8.2, 8.3).
  4. Select Your Desired PHP Version
    Click on the version you want. Some interfaces also let you enable or disable specific PHP extensions.
  5. Click Apply or Save Changes
    Save your settings. The change takes effect within 1–2 seconds.
  6. Verify the Change
    Refresh your phpinfo.php page to confirm the PHP version has been updated.
📌 Note On AsiaGB Hosting, you can change your PHP version yourself through DirectAdmin without contacting support. The change is instant with no server restart required.

Setting PHP Version via .htaccess

You can also control PHP version through .htaccess, which is useful for specific directories:

# Set PHP 8.2 via .htaccess (depends on your hosting setup)
AddHandler application/x-httpd-php82 .php
⚠️ Note The .htaccess method varies by server configuration. Using PHP Selector in DirectAdmin is recommended as it's more reliable and straightforward.

Setting Different PHP Versions Per Domain

If you host multiple domains in one account, you can set a different PHP version for each domain:

  1. Log in to DirectAdmin → go to Domain Setup
  2. Select the domain you want to configure
  3. Look for PHP Version or PHP Mode options
  4. Select the desired PHP version for that domain → Save

This allows one domain running a legacy application (PHP 7.4) and another with a modern app (PHP 8.3) to coexist in the same account without conflict.

PHP Version Comparison Table

PHP VersionStatusPerformanceKey FeaturesRecommended?
PHP 7.4End of Life (2022)ModerateType properties, Arrow functions❌ No
PHP 8.0End of Life (2023)GoodJIT, Named args, Match, Nullsafe❌ No
PHP 8.1Security fixes onlyVery goodFibers, Enums, Readonly properties✅ Acceptable
PHP 8.2Active Support ✅ExcellentReadonly classes, DNF Types✅ Recommended
PHP 8.3Latest ✅BestTyped class constants, json_validate()✅ Highly recommended

Best PHP Version for WordPress

WordPress has official PHP version recommendations:

Before Upgrading PHP for WordPress

  1. Back up all files and database first
  2. Check your theme's compatibility with the new PHP version
  3. Check all installed plugins for PHP compatibility
  4. Test on a staging environment if possible
  5. After upgrading, test all pages thoroughly
💡 Pro Tip The free PHP Compatibility Checker plugin from WordPress.org scans all your installed plugins and themes for compatibility with your target PHP version. Run it before upgrading.

Troubleshooting After PHP Version Change

Here are common issues and solutions after changing PHP version:

HTTP Error 500 (Internal Server Error)

Missing PHP Extensions

Session or Cookie Issues

Frequently Asked Questions

What happens if my site breaks after changing PHP version?

Revert to the previous PHP version immediately, then check the error log in DirectAdmin to identify deprecated functions or missing extensions. Update your plugins and code to be compatible with the new PHP version before trying the upgrade again.

Which PHP version is best for WordPress in 2026?

WordPress recommends PHP 8.1 or higher for WordPress 6.x. PHP 8.2 and 8.3 are fully supported and offer the best performance. PHP 7.4 no longer receives security updates and should be upgraded as soon as possible.

Do I need to restart the server after changing PHP version?

No. On shared hosting with DirectAdmin, the PHP-FPM pool is managed by your host. Simply save the PHP version setting in PHP Selector and the change takes effect immediately without any server restart.

Can I set different PHP versions for each domain?

Yes, if your hosting provider supports MultiPHP on DirectAdmin. You can set a different PHP version for each domain within the same account through Domain Setup or the per-domain PHP Selector.

How do I check my current PHP version?

Create a file called phpinfo.php in your public_html folder with the content <?php phpinfo(); ?> and open it in your browser. You can also see your current PHP version in DirectAdmin under Extra Features > PHP Selector. Always delete phpinfo.php after checking.

Summary

Changing PHP version on DirectAdmin hosting is quick and easy — just a few clicks in the PHP Selector, and the change is instant with no server restart needed.

AsiaGB Hosting supports all PHP 8.x versions with SSD storage, 99% uptime, and easy-to-use DirectAdmin. View our hosting plans