If you use the Yoast SEO plugin for WordPress, you might have noticed a new popup recently encouraging you to upgrade your website’s version of PHP. Beginning with Yoast SEO 4.5, released in late March, Yoast added the “nag screen” for sites running PHP 5.2. If you’ve seen this, you might be wondering why Yoast 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 version of PHP is 7.3, released on December 6, 2018.
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 will be supported with security updates through December 2019, 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.1 is the lowest version that is still receiving security updates, you should update your site to at least PHP 7.1. WordPress itself recommends PHP 7.2 and WordPress 5.2 requires at least PHP 5.6.20. Older versions of WordPress support PHP 5.2.4, although WordPress offers the warning that this version of PHP has reached its end of life and is vulnerable to security issues.
Beginning in WordPress 5.2, WordPress integrated a tool called the Site Health Project to alert you if you’re running a version of PHP that is incompatible with WordPress. 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.
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.2 or 7.3 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.