How to Resolve PHP Version Conflicts in WordPress
**Description:**A step-by-step guide for updating PHP versions and managing plugin compatibility in WordPress hosting environments. This article is tailored for Eco Web Hosting shared hosting customers using DirectAdmin.
Table of Contents
- Understanding PHP Version Conflicts
- How to Check Your Current PHP Version
- How to Update PHP Version via DirectAdmin
- Best Practices for Plugin Compatibility
- Troubleshooting Common Issues
- Practical Examples
- Further Assistance
Understanding PHP Version Conflicts
WordPress and its plugins require specific PHP versions to run optimally. Running an outdated PHP version can:
- Cause plugins/themes to break or display errors
- Expose your site to security vulnerabilities
- Limit performance and new features
Common symptoms of PHP version conflicts:
- “Your PHP version is outdated” warnings in WordPress dashboard
- Plugins/themes refuse to activate or update
- White screen of death or fatal error messages
How to Check Your Current PHP Version
Option 1: Inside WordPress
- Log in to your WordPress admin area (
/wp-admin
) - Go to Tools > Site Health
- Click the Info tab
- Expand the Server section to view your PHP version
Option 2: Using DirectAdmin
- Log in to your Eco Web Hosting client area
- Click Manage Hosting for your domain
- In DirectAdmin, go to Extra Features > Select PHP VersionYour current PHP version will be displayed at the top.
How to Update PHP Version via DirectAdmin
Eco Web Hosting allows you to change your PHP version for each hosting account or domain.
Step-by-Step:
- Access DirectAdmin
- Log in via your Eco Web Hosting client area and select your hosting package.
- Navigate to PHP Selector
- Go to Extra Features > Select PHP Version.
- Change the PHP Version
- Use the dropdown to select your desired PHP version (e.g.,
8.1
,8.2
) - Click Set as current or Apply.
- Use the dropdown to select your desired PHP version (e.g.,
- Enable Required Extensions
- Tick checkboxes for extensions commonly required by WordPress such as:
mysqli
pdo_mysql
curl
zip
gd
- Click Save if needed.
- Tick checkboxes for extensions commonly required by WordPress such as:
- Test Your Website
- Visit your WordPress site and ensure it loads correctly.
- Log in to the WordPress dashboard and check for errors.
Best Practices for Plugin Compatibility
- Before updating PHP:
- Update WordPress core, themes, and plugins to their latest versions.
- Check plugin documentation for supported PHP versions.
- Deactivate outdated or unsupported plugins.
- After updating PHP:
- Clear your WordPress and browser cache.
- Test key site features and forms.
- If a plugin fails, revert to a previous PHP version and contact the plugin developer.
Troubleshooting Common Issues
1. Website Shows Errors or White Screen
- Switch back to your previous working PHP version in DirectAdmin.
- Disable all plugins via File Manager or FTP by renaming the
/wp-content/plugins/
folder. - Reactivate plugins one by one to identify the incompatible plugin.
2. Plugin or Theme Won’t Activate
- Check the plugin or theme requirements.
- Ensure all required PHP extensions are enabled.
- Consider using an alternative plugin that supports your PHP version.
3. “PHP Extension Missing” Errors
- Return to Select PHP Version in DirectAdmin.
- Enable the required extension (e.g.,
intl
,json
,mbstring
). - Save and refresh your site.
4. Fatal Error Example
Fatal error: Uncaught Error: Call to undefined function mb_strlen()
**Solution:**Enable the mbstring
extension in DirectAdmin’s PHP Selector.
Practical Examples
Example: Enabling a Missing Extension
Suppose a plugin needs the zip
extension and your site gives an error:
- Go to Extra Features > Select PHP Version in DirectAdmin.
- Tick the
zip
box. - Click Save.
- Refresh your website.
Example: Reverting PHP Version
If your site breaks after switching to PHP 8.2:
- Return to Select PHP Version.
- Choose your previous version (e.g.,
8.0
or7.4
). - Apply changes.
- Site should return to normal.
Further Assistance
If you’ve followed the steps above and still experience issues:
- Take note of any error messages or plugin names involved.
- Check our Knowledge Base for more guides.
- If you need help, please open a support ticket via your client area with:
- Your domain name
- PHP version tried
- Plugins/themes affected
- Any error messages seen
**Tip:**Making regular backups before changing PHP versions can help you restore your site quickly if needed.
Eco Web Hosting – Helping you maintain a secure and compatible WordPress site!