Fix Guide

How to Update PHP on Your WordPress Hosting

February 8, 2026

Running an outdated PHP version is one of the biggest performance and security mistakes you can make with a WordPress site. PHP is the language that powers WordPress, and every new version brings measurable speed improvements, security patches, and new language features that plugins and themes rely on. If your hosting still runs PHP 7.4 or even PHP 8.0, you are leaving performance on the table and exposing your site to known vulnerabilities that will never be patched.

Why Your PHP Version Matters for WordPress

PHP is not just a background detail. It directly affects how fast your pages load, how much memory your server uses, and whether your plugins can run at all. Each major PHP release includes internal optimizations to the Zend Engine (the runtime that executes PHP code), and these optimizations compound over time. A WordPress site running PHP 8.3 will handle more requests per second, use less memory per request, and respond faster than the same site on PHP 7.4.

Beyond performance, there is the security angle. PHP 7.4 reached its official end of life (EOL) in November 2022. PHP 8.0 reached EOL in November 2023. PHP 8.1 reached EOL in December 2025. Once a version hits EOL, the PHP team stops releasing security patches entirely. If a critical vulnerability is discovered in an EOL version, it will never be fixed. Your hosting provider might backport some patches, but you should not rely on that.

PHP Version Comparison: Performance and Features

Here is a practical breakdown of the major PHP versions you will encounter on WordPress hosting:

  • PHP 7.4 (EOL November 2022): The last release in the PHP 7.x line. It was a solid version in its time, but it lacks typed properties, union types, fibers, and the performance gains from PHP 8.x. WordPress 6.4+ officially recommends PHP 8.0 or higher. Many newer plugins have dropped PHP 7.4 support entirely.
  • PHP 8.0 (EOL November 2023): Introduced the JIT (Just-In-Time) compiler, named arguments, union types, match expressions, and nullsafe operators. The JIT compiler does not dramatically improve typical WordPress workloads (which are I/O-bound rather than CPU-bound), but the general engine optimizations still deliver a 5-10% speed boost over PHP 7.4.
  • PHP 8.1 (EOL December 2025): Added fibers (used by newer async libraries), enums, readonly properties, and intersection types. WordPress core has full support. Most well-maintained plugins work fine on 8.1.
  • PHP 8.2 (Security fixes until December 2026): Introduced readonly classes, deprecated dynamic properties (which caused some older plugins to throw deprecation notices), and improved the random number generator. This is a good target version if you want stability with ongoing security support.
  • PHP 8.3 (Active support until December 2026, security fixes until December 2027): Added typed class constants, the json_validate() function, and various performance improvements. This is currently the recommended version for new WordPress installations, as it has the longest remaining support window and the best performance.

Performance Benchmarks: What the Numbers Actually Look Like

In real-world WordPress benchmarks (tested with a standard WooCommerce installation, 20 active plugins, and a theme like Astra), the differences between PHP versions are significant:

  • PHP 7.4: Handles roughly 90-100 requests per second, with an average response time of about 250ms.
  • PHP 8.0: Handles roughly 100-115 requests per second, average response time around 220ms.
  • PHP 8.1: Handles roughly 110-120 requests per second, average response time around 210ms.
  • PHP 8.2: Handles roughly 115-125 requests per second, average response time around 200ms.
  • PHP 8.3: Handles roughly 120-135 requests per second, average response time around 190ms.

These numbers vary depending on hosting environment, but the trend is consistent: each PHP version is measurably faster than its predecessor. Upgrading from PHP 7.4 to 8.3 typically yields a 25-35% improvement in requests per second.

Before You Update: The Pre-Upgrade Checklist

  1. Create a full backup: Back up both your database and files. Use UpdraftPlus, BackWPup, or your hosting provider's built-in backup tool. Do not skip this step. If something goes wrong, you need to be able to restore your site in minutes.
  2. Check plugin and theme compatibility: Install the "PHP Compatibility Checker" plugin by WP Engine. It scans your plugins and theme files for function calls that are deprecated or removed in newer PHP versions. Pay attention to any "ERROR" results, as those will cause fatal errors. "WARNING" results usually just trigger deprecation notices that do not break functionality.
  3. Review the PHP migration guides: The official PHP documentation publishes migration guides for each version (php.net/migration80, php.net/migration81, etc.). These list every breaking change. You do not need to read the entire guide, but skim the "Backward Incompatible Changes" section.
  4. Use a staging environment: If your hosting provider offers staging (Kinsta, WP Engine, SiteGround, and most managed hosts do), clone your production site to staging and test the PHP upgrade there first. This is the single most important step for avoiding downtime.
  5. Update all plugins and themes first: Before changing the PHP version, make sure every plugin and theme is running the latest version. Developers regularly release updates that add compatibility with newer PHP versions.

How to Change Your PHP Version

cPanel Hosting (Most Shared Hosts)

  1. Log in to your cPanel dashboard.
  2. Look for "Select PHP Version" (CloudLinux) or "MultiPHP Manager" (native cPanel). The name depends on your hosting provider's configuration.
  3. If using MultiPHP Manager, select your domain from the list, choose the new PHP version from the dropdown, and click "Apply."
  4. If using Select PHP Version, you will see the current version at the top. Click the dropdown, select the new version, and confirm. This interface also lets you enable or disable individual PHP extensions.

Plesk Hosting

  1. Log in to Plesk and navigate to Websites & Domains.
  2. Click on the domain you want to update.
  3. Click PHP Settings (or "PHP Version" depending on your Plesk version).
  4. Select the new PHP version from the dropdown and click "Apply" or "OK."
  5. Plesk also allows you to configure PHP settings (memory_limit, max_execution_time, etc.) on the same page.

Managed WordPress Hosting

Managed hosts typically make PHP version switching straightforward:

  • Kinsta: Go to Sites, select your site, click Tools, find "PHP Engine" and select the new version.
  • WP Engine: Go to Sites, select your environment, click Overview, and find the PHP version setting. WP Engine also has a PHP Compatibility Checker built into their dashboard.
  • SiteGround: Go to Site Tools, then PHP Manager under the Devs section. You can set the PHP version per folder if needed.
  • Cloudways: Go to Server Management, Settings & Packages, then the Packages tab. Change the PHP version there (this affects the entire server).

Common Errors After Upgrading PHP

If your site shows errors after a PHP upgrade, do not panic. Here are the most common issues and their fixes:

Fatal Error: Uncaught Error (Function Not Found)

This happens when a plugin or theme uses a PHP function that was removed in the new version. Common examples include create_function() (removed in PHP 8.0), each() (removed in PHP 8.0), and mysql_* functions (removed since PHP 7.0). The fix is to update the plugin or theme that triggers the error. Check the error message for the file path to identify which plugin is responsible.

Deprecation Notices Filling Your Error Log

PHP 8.2 deprecated dynamic properties (setting undeclared properties on objects), which caused a flood of deprecation notices in many older plugins. These notices do not break your site, but they can slow things down if error logging is verbose. Update the affected plugins, or if a plugin is abandoned, consider replacing it with an alternative.

White Screen of Death

A completely blank page usually means a fatal error is happening but error display is turned off. Enable error display temporarily by adding this to your wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_DISPLAY', true);
define('WP_DEBUG_LOG', true);

Check the error, fix it, and then disable debug mode again in production.

Type Errors and Stricter Type Checking

PHP 8.x is stricter about type handling. Passing null to internal functions that expect a string (like strlen(null)) now throws a deprecation warning or a TypeError. This commonly shows up in poorly-coded plugins that do not check for null values before passing them to string functions.

Essential php.ini Settings for WordPress

After upgrading PHP, review these key php.ini settings. You can usually edit them through your hosting control panel, or by creating a custom php.ini or .user.ini file in your WordPress root directory:

; Memory limit - WordPress recommends at least 256M
memory_limit = 256M

; Maximum upload size
upload_max_filesize = 64M
post_max_size = 64M

; Execution time - increase if you have slow imports or large operations
max_execution_time = 300

; Input variables - increase if you have complex forms or many custom fields
max_input_vars = 3000

; Error reporting - disable display_errors in production
display_errors = Off
log_errors = On
error_log = /path/to/php-error.log

OPcache Configuration for Best Performance

OPcache stores precompiled PHP bytecode in shared memory, so the PHP engine does not have to parse and compile the same scripts on every request. It is enabled by default on most hosting providers, but the default settings are often too conservative for WordPress. Here are recommended OPcache settings:

opcache.enable = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 10000
opcache.revalidate_freq = 60
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 1

The opcache.max_accelerated_files setting should be higher than the total number of PHP files in your WordPress installation. A typical WordPress site with 20 plugins has around 5,000-8,000 PHP files. Setting this to 10,000 provides headroom. The opcache.revalidate_freq controls how often OPcache checks if source files have changed. On production, 60 seconds is a good balance. Set it to 0 on development environments so changes are picked up immediately.

How to Check Which PHP Version Your Plugins Require

Not all plugins declare their minimum PHP version, but the good ones do. Here is how to check:

  • WordPress.org plugin page: Scroll down to the "Requires PHP" field in the sidebar. If the plugin lists "7.4" and you are on 8.3, you should still be fine in most cases, as this indicates the minimum, not the maximum.
  • Plugin readme.txt: Open the plugin's readme.txt file (in wp-content/plugins/plugin-name/readme.txt) and look for the "Requires PHP" header.
  • Plugin source code: The main plugin file (the one with the Plugin Name header) sometimes includes a "Requires PHP" header comment that WordPress reads.
  • Changelog and release notes: Check the plugin's changelog for mentions of PHP version requirements, especially if you are upgrading multiple major versions.

Rollback Procedure If Something Breaks

If your site breaks after a PHP upgrade and you cannot fix the issue quickly, roll back to the previous PHP version immediately. Here is the procedure:

  1. Change the PHP version back: Use the same cPanel, Plesk, or hosting dashboard method you used to upgrade. Switching back takes effect within seconds on most hosts.
  2. Verify your site is working: Load your site in a browser and check the admin dashboard. Everything should be back to normal.
  3. Investigate the issue: Now that your site is stable again, look at the error logs to identify the problematic plugin or theme. Update it or find an alternative.
  4. Try again: Once you have resolved the compatibility issue, attempt the PHP upgrade again on staging first, then on production.

If you cannot roll back through the hosting dashboard (for example, if you are locked out of cPanel), you can usually contact your hosting provider's support and they will change the PHP version for you within minutes.

After Updating: Post-Upgrade Verification

  1. Visit your site's homepage and several inner pages. Look for visual issues, broken layouts, or error messages.
  2. Test critical functionality: contact forms, WooCommerce checkout (if applicable), login and registration, search, and any custom features.
  3. Check the WordPress admin dashboard for plugin warnings or update notices.
  4. Open wp-content/debug.log (if WP_DEBUG_LOG is enabled) and look for new PHP errors or deprecation notices.
  5. Monitor your server's PHP error log for at least 24-48 hours. Some issues only appear under specific conditions (certain page templates, cron jobs, API calls).
  6. Clear all caches (page cache, object cache, OPcache) so they rebuild with the new PHP version.

Verify Your PHP Version with InspectWP

Run a new InspectWP scan after upgrading. The hosting section displays the detected PHP version from the server headers. If the version has not changed, your hosting provider may be caching the old PHP handler. Clear your server cache, wait a few minutes, and scan again. InspectWP also flags outdated PHP versions in the security section, so you can confirm that warning is resolved after upgrading.

Check your WordPress site now

InspectWP analyzes your WordPress site for security issues, SEO problems, GDPR compliance, and performance — for free.

Analyze your site free