From page templates and the WordPress dashboard to the plugins and themes installed on a website, PHP is a programming language that is inextricable from the platform we call WordPress.
What is PHP?
PHP is a popular programming language that’s mainly used to create websites. It’s an open-source language that’s free to use, just like WordPress. In light of this fact, it’s easy to see why PHP is among the most commonly used languages in web development.
For example, popular websites such as Facebook have PHP running behind the scenes. It’s also what most of WordPress core is coded with. And you can use PHP for many exciting things, such as automating your WordPress login page and managing your WordPress posts.
Because PHP is a server-side language, you’ll have to tackle site performance issues related to PHP by yourself. Even if someone had the most cutting-edge computer in the world, they’d still encounter issues when loading your website if you’re dealing with PHP-related site performance problems.
Why Updating Your WordPress Site’s PHP Version is Important
PHP is inextricable from your WordPress site and its performance – it’s responsible for pulling the right data from your database, packing it up in CSS and HTML, and rendering a complete website visible from your users’ internet browsers. In other words, if PHP slows down, so does everything else.
Additionally, it’s important that you keep your WordPress site’s PHP version up to date since using old versions can compromise your site’s security to vulnerabilities and cybersecurity threats. It’s little wonder, then, that PHP as a language has been consistently iterated throughout the years, spawning a ton of versions as a result.
According to WordPress’s official recommendation, you’ll want your server to at least be running PHP 7.4 so that you can run the current version of WordPress. As PHP improves over time, it becomes much faster and more secure. Security and speed are especially important for WordPress site owners or their employees who may need to access their sites remotely through a VPN (which is common, as statistics show that 15% of people utilize a VPN daily). At the time of this article’s writing, you’ll have the greatest speed and security if you’re running PHP 8.1 on your server.
Before you jump into checking and updating your WordPress site’s PHP version, it’s important to know that active support for older PHP versions is running out. Support for version 7.4, for instance, was removed in 2020, with its security support ceasing toward the end of 2021. So, if you need other reasons to update your WordPress site’s PHP version, the lack of active and security support for older versions will hopefully convince you.
How to Check Your WordPress Site PHP Version
There are several options at your disposal when it comes to checking your WordPress site’s PHP version. We’ll focus on three ways to view it below.
View Your PHP Version on WordPress’ Site Health Section
The first and easiest way to view your PHP version is to simply log into your site and navigate to Tools > Site Health and click on the ‘Info’ tab. Then scroll down to where you see an accordion label for ‘Server’ and click to open it. Here you can quickly find your current PHP version, along with lots of other helpful information about your server, themes, plugins, and your WordPress site in general.
Check Your PHP Version with Your Hosting Provider
Another way to check your site’s PHP version is by checking your hosting management panel. If you access your hosting account and search its back end, you should be able to locate a menu named something similar to general ‘Site Information’ or ‘PHP Settings.’
For WP Engine users, this information is promptly displayed on your Sites section when you log in. You can see which version you’re using directly through these settings, and you’ll be able to upgrade to a later version through the same settings as well.
Use a Troubleshooting Plugin
As a WordPress site owner, you have the luxury of being able to use plugins. And depending on your needs you may already be using (or want to install) an all-in-one type troubleshooting plugin like WP Tools. For this plugin specifically there is a ‘PHPINFO’ tool that will display your PHP version, server configuration, etc. Using this plugin is straightforward: simply install it and then activate it, after which you’ll be able to check what your current PHP version is via your WordPress dashboard (as well as a ton of other information).
Now, if you already happen to be running the latest PHP version on your server, you can stop here. If, however, you need to upgrade your PHP version safely, then keep reading.
How to Update Your PHP Version for WordPress
Before you upgrade your PHP version, first things first.
- Check to see what the latest compatible version of PHP is for WordPress. You can view PHP compatibility in the Make WordPress Handbook, as well as a nifty chart that shows which WordPress versions play nice with each PHP version.
- Backup your WordPress site in case you run into incompatibilities between your site’s existing code (such as your WP themes, scripts, and plugins) and the version of PHP that you’re upgrading to.
Once you’ve created your local copy and finished backing up your site, you can also use the free PHP Compatibility Checker WordPress plugin to verify that you have no compatibility issues. Install the plugin and, once it’s installed, scan for potential errors and warnings and then update or possibly replace your incompatible themes or plugins. You can also follow the suggestions that PHP Compatibility Checker gives you.
To actually upgrade your version of PHP, log into your hosting provider’s administrator dashboard. For WP Engine users, you’ll see a warning symbol next to your PHP version if there is an update available.
Just click to open a pop-up window and proceed with your PHP upgrade. It’s that easy!
Alternatively, your admin dashboard might have a menu item called something similar to ‘PHP Version Manager,’ after which you can go to the location of your website and choose the PHP version you want to run. Certain admin panels may require you to conduct your own search to find the necessary tool with which to upgrade – in this case; you may want to contact your provider.
Note: Because PHP is used on your server, which is typically owned and managed by your hosting company, they are the ones who decide when a PHP update will be available to you. This is a good thing though since trusted WordPress hosts will test for stability and compatibility before upgrading their server PHP and enabling update options for their customers.
PHP is the thing that keeps all the pieces of your WordPress site together, and it’s essential that you keep your PHP version updated. Doing so will provide you with greater site security and speed, and if you’ve checked and upgraded your PHP version per the steps laid out in this article, your site is in perfect shape to continue into the future!