WordPress

PHP Versions and WordPress: What to Run and When to Upgrade

WordPress runs on PHP, and the version you choose affects speed, security and plugin compatibility. Here is how to pick, test and switch safely.

By Zebra Hosting Cloud

WordPress is written in PHP, and so are its plugins and themes. The PHP version on your hosting account therefore affects how fast your site runs, how secure it is and whether your plugins work at all. Yet many site owners never look at it. A few minutes spent on this setting is among the cheapest improvements you can make.

Why PHP versions matter

PHP is released in versions, and each version is supported with fixes for a limited time. Once a version reaches end of life, it no longer gets security patches. Running an unsupported version means known flaws stay open. Newer versions are also usually faster and use memory more efficiently than older ones, so upgrading can speed up your site without any other change.

Finding and choosing a version

  • In WordPress, go to Tools, then Site Health, then the Info tab, and open the Server section.
  • In your hosting control panel, the PHP settings for the domain show the version. In Plesk, this is under the PHP settings for your subscription or domain.

Site Health also warns you if your PHP version is outdated, and it shows which version WordPress recommends.

What WordPress recommends

WordPress publishes its recommended and minimum PHP requirements on its official site. The minimum is often lower than what you should run. Aim for a version that is both actively supported by the PHP project and officially compatible with your WordPress version. Check the official sources for the current numbers instead of relying on an article that may be out of date.

Upgrading safely

The risk in upgrading is not WordPress itself, which supports new PHP versions fairly quickly. It is older plugins and themes. Abandoned code may use features that newer PHP removed or changed, producing warnings, broken pages or a white screen.

That is why you test before switching.

How to upgrade PHP safely

  1. Back up files and database.
  2. Update WordPress core, plugins and themes first. Many compatibility fixes arrive through updates.
  3. Check plugin and theme pages for stated PHP compatibility. Remove unmaintained ones.
  4. Test on staging, with the new PHP version set for the staging domain only.
  5. Turn on debugging on staging with WP_DEBUG and look for deprecation notices and errors.
  6. Test key pages and functions, including forms, checkout and the admin area.
  7. Switch live at a quiet time and re-test.
  8. Know how to switch back. Changing the PHP version in your panel is reversible, which is a good safety net.

Understanding warnings

You will see two main types of messages in the debug log:

  • Deprecated: the code works now but uses something that will be removed. Tell the plugin developer and plan a replacement.
  • Fatal error or warning: something is broken. Identify the file path in the message; it usually names the responsible plugin or theme.

Do not leave debug display on for visitors on a live site. Log errors to a file instead.

Settings and extensions

Several PHP settings affect WordPress:

SettingWhat it controls
memory_limitHow much memory a script may use; builders and shops need more
max_execution_timeHow long a script may run before it is stopped
upload_max_filesize and post_max_sizeLargest upload allowed
max_input_varsNumber of form fields accepted, relevant to large menus and complex pages

If you see errors such as allowed memory size exhausted, raising the memory limit is a common fix, though it can also point to a plugin that needs attention.

Extensions WordPress needs

WordPress requires some PHP extensions and benefits from others, such as those for database access, image processing, internationalisation and secure connections. Site Health tells you if something recommended is missing. A good host enables the usual set by default.

Keep a calendar

Check PHP support dates once or twice a year, and schedule upgrades before your version reaches end of life. A small yearly step is much easier than a jump across several major versions on a site with years of accumulated plugins.

Why hosts retire old versions

Hosting providers eventually remove old PHP versions from their platform, because they no longer receive security fixes and cost effort to maintain. If your site depends on one, you may be forced to move at short notice. Watching announcements from your host and from the PHP project lets you upgrade on your own schedule, with time to test, instead of in a hurry when something stops working.

One version for the whole account, or per domain?

If you host several sites in one account, check whether you can set the PHP version per domain. That lets you upgrade the sites with tidy, modern code first and leave an old, fragile site on an older supported version a little longer while you plan its replacement. Do not leave it there forever, though; unsupported PHP is a security risk.

PHP management with Zebra Hosting

With Plesk on every hosting plan, you can change the PHP version and key settings yourself, per domain, which also makes testing on a subdomain easy. Our WordPress hosting is built around this flexibility, and if you are unsure which settings fit your site, support is available in 17 languages. Step-by-step help lives in the knowledgebase.