Beginning with WordPress 5.2, WordPress introduced the Site Health Check. On your Dashboard, you’ll see a warning if your website has a technical issue that needs to be addressed. One of those things is the version of PHP your website is running. You might be wondering why WordPress cares what version of PHP you run or what that even is. Let’s take a closer look at what PHP is, how to tell what version you’re running, why it matters, and how to upgrade.
PHP: The language of WordPress
From a user standpoint, WordPress is, at its core, a custom interface to help you build a website much more easily than you can from scratch. From a development standpoint, however, WordPress is not only a content management system but also a custom library of PHP functions.
What does this mean? Well, sites on the internet can be written in one of several programming languages. WordPress is written in PHP, and WordPress offers developers what is known as the WordPress Codex. The Codex offers WordPress developers a set of functions to make theme and plugin development easier. For example, you can use the code
get_footer() to display the contents of a page’s footer. This is a function possible in WordPress that isn’t possible in regular PHP.
Why does the version number matter?
Because WordPress is built on PHP, that means that the version of PHP you use is as important as the version of WordPress you use. Each version offers new features but it also offers stability improvements and fixes bugs. Perhaps more importantly, new versions of the software also repair security issues.
Like operating systems or other software, previous versions aren’t supported forever. You wouldn’t want to run Windows 98 or Mac OS 9 on a brand new computer, right? Those versions of the software are old and unsupported. You’d miss out on a lot of new features, but you’d also be vulnerable to a bunch of bugs and security issues that are repaired in newer versions of the software. PHP 5.2, released in January 2011, has about 40 known security vulnerabilities. It’s also 400% slower than PHP 7.0.
What version of PHP should you run?
The current major version of PHP is 7.4, released on November 28, 2019.
PHP supports multiple versions at once at least with security updates, supporting each version for 3-4 years before ending updates completely. PHP 5.6 and 7.0 were both recently phased out in December 2018. PHP 7.1 was phased out December 2019, PHP 7.2 will be supported through November 2020, and 7.3 will be supported through December 2021. (In case you’re wondering, PHP skipped version 6. It’s a long story.)
Because PHP 7.2 is the lowest version that is still receiving security updates, you should update your site to at least PHP 7.2. WordPress itself recommends PHP 7.4 and the current version of WordPress requires at least PHP 5.6.20. Older versions of WordPress support PHP 5.2.4, although WordPress offers the warning that any version of PHP 5 has reached its end of life and is vulnerable to security issues.
If you want to know exactly what version of PHP you’re running, the easiest way to check your site’s version of PHP is to install a very simple plugin called Display PHP Version. This will add the version of PHP your site runs into your WordPress Dashboard. You can check compatibility with newer PHP versions using the PHP Compatibility Checker plugin. However, assuming you’re running WordPress 5.2 or later, you can also rely on the Site Health Check to warn you if your version of PHP needs to be upgraded.
Before upgrading your PHP version, you’ll want to be sure all your themes and plugins are compatible with it. If your theme and plugins are all compatible with new versions, running PHP 7.4 is ideal.
How do you upgrade your PHP version?
Upgrading depends on your hosting provider. Most major hosts provide a way to upgrade through their cPanel system. Select your hosting provider from the list below to see how to upgrade PHP with that host. If you host isn’t listed, you can probably find upgrade instructions by searching Google for “upgrade PHP” followed by the name of your host.