PHP is an important part of your WordPress website. Today I’ll cover what exactly PHP is, how to check what version of PHP you’re running and how to update PHP (if needed).
What is PHP?
PHP is a server-side scripting language used by WordPress. WordPress uses PHP to build each web page you see. It does this in a number of ways — by getting content from the database, validating permissions, checking options, calling plugins — the list is endless.
PHP is the coding language WordPress is built on, and its version is set at the server-level by your hosting company. Whilst you may be familiar with the importance of keeping WordPress, and your themes and plugins up-to-date, keeping PHP up-to-date is just as important.wordpress.org
Sites with current versions of PHP are faster and more secure — which is what we all want in a site, right?
What version of PHP am I using?
Navigate to Tools, Site Health. If you’re running an older version of PHP (that WordPress doesn’t recommend), you’ll see it under Status.
Otherwise, if you check under Passed tests, you’ll see the version you’re running.
You can also find more information about PHP under Site Health, Info, Server, including your max input variables, time limit, memory limit and so on.
Wait, what version of PHP should I be using?
As of this writing, you should be using PHP version 7.4 or greater.
Each release branch of PHP is fully supported for two years from its initial stable release. After this two year period of active support, each branch is then supported for an additional year for critical security issues only. Once the three years of support are completed, the branch reaches its end of life and is no longer supported.php.net
If you need to upgrade your PHP version, check with your host. Each host will have its own way of updating PHP.
In Flywheel, go to Advanced and PHP Version. Only supported PHP versions are available on Flywheel; if you need to update, reach out and they’ll update it for you. Learn more about PHP on Flywheel.
In Kinsta, look under Tools, PHP engine. Click the Modify button to change the version. Learn more about updating PHP on Kinsta.
If your web host runs cPanel, navigate to Select PHP Version, then change the version under the PHP Selector.
After you update PHP, check your site to make sure everything still functions as expected. If you see any issues, you can roll back, then investigate further on a staging or local site if possible. If you’re keeping your themes, plugins and WordPress up-to-date, though, hopefully you won’t have any problems when you update PHP.
Technology is ever-changing and WordPress is no different! Keeping your WordPress site up-to-date (including your version of PHP) will not only provide the best user experience, but keep your site secure as well.