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.
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:
PHP 7.4 (Legacy — End of Life, not recommended)
PHP 8.0 (End of Life)
PHP 8.1 (Security Support)
PHP 8.2 (Active Support — recommended)
PHP 8.3 (Latest — most recommended)
💡 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:
Security: Older PHP versions no longer receive security patches, leaving your site vulnerable to attacks
Performance: PHP 8.x is significantly faster than PHP 7.x, reducing server load and page load times
Compatibility: Modern plugins, themes, and frameworks require PHP 8.x
JIT Compiler: PHP 8.0+ includes JIT compilation for CPU-intensive tasks
New Features: Named Arguments, Match Expressions, Fibers, and more enable cleaner, more efficient code
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
Log in to your DirectAdmin panel
Navigate to Extra Features → PHP Selector or Select PHP Version
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:
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.
Go to Extra Features
On the DirectAdmin dashboard, find the Extra Features or Advanced Features section.
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).
Select Your Desired PHP Version
Click on the version you want. Some interfaces also let you enable or disable specific PHP extensions.
Click Apply or Save Changes
Save your settings. The change takes effect within 1–2 seconds.
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:
Log in to DirectAdmin → go to Domain Setup
Select the domain you want to configure
Look for PHP Version or PHP Mode options
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 Version
Status
Performance
Key Features
Recommended?
PHP 7.4
End of Life (2022)
Moderate
Type properties, Arrow functions
❌ No
PHP 8.0
End of Life (2023)
Good
JIT, Named args, Match, Nullsafe
❌ No
PHP 8.1
Security fixes only
Very good
Fibers, Enums, Readonly properties
✅ Acceptable
PHP 8.2
Active Support ✅
Excellent
Readonly classes, DNF Types
✅ Recommended
PHP 8.3
Latest ✅
Best
Typed class constants, json_validate()
✅ Highly recommended
Best PHP Version for WordPress
WordPress has official PHP version recommendations:
WordPress 6.x requires PHP 7.2.5+ but strongly recommends PHP 8.1+
PHP 8.2 and 8.3 are officially recommended by WordPress for best compatibility
PHP 7.4 still works but is no longer receiving security updates
Before Upgrading PHP for WordPress
Back up all files and database first
Check your theme's compatibility with the new PHP version
Check all installed plugins for PHP compatibility
Test on a staging environment if possible
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)
Revert to your previous PHP version immediately
Check the error log in DirectAdmin → Error Log
Usually caused by deprecated or removed functions in the new PHP version
Missing PHP Extensions
Go to PHP Selector → enable required extensions such as mbstring, gd, or curl
Some extensions may require contacting support to enable
Session or Cookie Issues
Check php.ini settings for session.save_path
Try clearing your browser cache and cookies
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.
Use PHP 8.2 or 8.3 for new sites and the latest WordPress
Always check plugin and theme compatibility before upgrading
Back up your site before changing PHP version
If the site breaks, revert to the previous version and check error logs
Different PHP versions can be set per domain if MultiPHP is supported
AsiaGB Hosting supports all PHP 8.x versions with SSD storage, 99% uptime, and easy-to-use DirectAdmin. View our hosting plans