How to Upgrade and Configure PHP for WordPress Performance
How to Upgrade and Configure PHP for WordPress Performance
**Description:**A step-by-step guide for shared hosting customers to check, upgrade, and configure their PHP version for
optimal WordPress performance. This article covers how to select your PHP version (with a focus on DirectAdmin), what to
expect from different versions, and practical troubleshooting tips.
Table of Contents
- Why PHP Version Matters for WordPress
- How to Check Your Current PHP Version
- How to Select or Upgrade Your PHP Version in DirectAdmin
- Configuring PHP Extensions and Settings
- Troubleshooting Common PHP Upgrade Issues
- Frequently Asked Questions
Why PHP Version Matters for WordPress
- Performance: Newer PHP versions (e.g., 8.1, 8.2, 8.3) are significantly faster than older versions.
- Security: Only supported PHP versions receive security updates. Older versions are a risk.
- Compatibility: Latest WordPress releases and plugins may require a minimum PHP version.
> **Tip:**WordPress recommends using PHP 8.0 or higher for best performance and security.
How to Check Your Current PHP Version
There are two main ways:
1. Using WordPress
- Log in to your WordPress admin dashboard.
- Go to Tools > Site Health.
- Click on the Info tab, then expand the Server section.
- Look for the PHP Version entry.
2. Using the Hosting Control Panel
- Log in to your Eco Web Hosting client area.
- Click Manage Hosting for your site.
- Open your hosting control panel
- Look for a section like PHP Selector, Select PHP Version, or PHP Settings.
- Your current PHP version will be displayed here.
How to Select or Upgrade Your PHP Version in DirectAdmin
> **Note:**Changing your PHP version only affects your website and does NOT require server admin access.
Step-by-Step: Upgrade PHP in DirectAdmin
1. Log in to DirectAdminAccess your hosting control panel via your client area or directly.
2. Navigate to PHP Selector
- Look for Extra Features or a similar section.
- Click on Select PHP Version (or PHP Selector).
3. View Current PHP Version
- At the top, see the current active version for your account or domain.
4. Choose a New PHP Version
- Click the dropdown list and select your desired version (e.g., 8.2).
- Click Set as current or similar button to apply the change.
5. Wait for the Update
- Changes are applied instantly, but it’s a good idea to refresh your site and test key pages.
6. (Optional) Test WordPress Functionality
- Visit your website and WordPress dashboard.
- Check if all plugins and themes are working.
- If something breaks, you can revert to the previous PHP version.
Configuring PHP Extensions and Settings
Optimizing PHP for WordPress means enabling the right extensions and adjusting settings as needed.
Enable Essential PHP Extensions
- In the PHP Selector screen, checkboxes for common extensions (modules) will be listed.
- Recommended for WordPress:
- mysqli
- pdo_mysql
- curl
- zip
- gd
- intl
- Tick the boxes to enable, and click Save or Apply if required.
Adjust PHP Options
- Click the Options tab or Switch to PHP Options link.
- Common settings to adjust:
- memory_limit (e.g., 256M)
- upload_max_filesize (e.g., 64M)
- post_max_size (e.g., 64M)
- max_execution_time (e.g., 120)
- Click the value to edit, select or type a new value, then Save.
> **Example:**To increase the upload limit for large plugins or themes: > > > upload_max_filesize = 64M >
post_max_size = 64M >
Troubleshooting Common PHP Upgrade Issues
1. Website Errors or White Screen
- Revert to Previous Version: Go back to the PHP Selector and choose your old version.
- Disable Plugins: Via WordPress admin, or rename the /wp-content/plugins/ folder using File Manager.
- Check .htaccess: Custom rules may need updating for new PHP versions.
2. Missing Extensions
- Double-check the relevant extensions are enabled in PHP Selector.
- Save changes and refresh your site.
3. Incompatible Themes or Plugins
- Update all plugins and themes to the latest versions.
- Check plugin documentation for PHP compatibility.
4. "Allowed Memory Size Exhausted" Error
- Increase the memory_limit in PHP Options (e.g., set to 256M).
5. Still Having Issues?
- Revert to the previous working PHP version.
- Consult the Eco Web Hosting Knowledge Base for more tips.
- You can open a support ticket with details if you need further help.
Frequently Asked Questions
**Q: Is it safe to upgrade PHP?**A: Yes, but always test your site after upgrading. Most WordPress sites work best with
the latest stable PHP version.
**Q: Will my website go offline during the upgrade?**A: No downtime occurs when changing PHP versions—changes are
instant.
**Q: Can I have different PHP versions for different domains?**A: Yes, you can set PHP versions per domain or subdomain
in DirectAdmin.
**Need more help?**If you encounter issues not covered here, please refer to our Knowledge Base or raise a support
ticket via your client area with specific details about the problem.