Change PHP version in DirectAdmin
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
- Go to Tools → Site Health
- Click Info
- Look for Server → PHP version
Via DirectAdmin
- Log in to DirectAdmin
- Go to PHP Settings or Domain Setup
- 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
- Log in to DirectAdmin
- Go to Domain Setup or Website Settings
- Click on your domain
- Find PHP Version Selector or PHP version
- Select the desired version (e.g., PHP 8.2)
- Click Save
Method 2: Via PHP Settings
- Log in to DirectAdmin
- Go to PHP Settings or PHP Configuration
- Select your domain (if you have multiple)
- Choose the PHP version from the dropdown menu
- Click Apply
Method 3: Per subdomain
You can use different PHP versions per subdomain:
- Go to Subdomain Management
- Click on the subdomain
- Change the PHP version specifically for that subdomain
- Click Save
Before changing: Check compatibility
WordPress compatibility
- Update WordPress to the latest version
- Update all plugins and themes
- Check plugin descriptions for PHP requirements
- Make a backup before changing
Common compatibility issues
Deprecated functions:
mysql_*functions no longer work (usemysqli_*or PDO)ereg_*functions are removed (usepreg_*)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
- Open your website in the browser
- Test all pages
- Check forms
- Test the shopping cart (if you have a webshop)
- 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
- Go to PHP Settings in DirectAdmin
- Find
memory_limit - Increase to 256M or 512M
- Click Save
Increase upload limit
- Go to PHP Settings
- Change
upload_max_filesize(e.g., 64M) - Change
post_max_size(slightly higher, e.g., 68M) - Click Save
Increase execution time
For longer processes:
- Go to PHP Settings
- Change
max_execution_time(e.g., 300) - Click Save
Rolling back to old version
If your website doesn't work after the upgrade:
- Go back to PHP Settings or Domain Setup
- Select the previous PHP version
- Click Save
- Test your website
This is a temporary solution. Plan to update your code for compatibility with newer PHP versions.
Tips for PHP updates
- Test locally first: Test on a staging environment before production
- Always make a backup: Database and files
- Update gradually: Don't jump from 7.4 to 8.3, go via 8.1
- Check error logs: Check logs after changing
- 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.
0 van 0 vonden dit nuttig