There’s no shortage of blogs and tutorials sharing advice on how to slash your page loading times and boost your site’s performance. However, there’s one element that’s often overlooked: PHP.

As a core component of WordPress, your version of PHP can mean the difference between a lightning-fast site, and sluggish loading times. By learning how to check the PHP version in WordPress, you can figure out whether this programming language is actually damaging your site’s performance.

In this post, we’ll discuss what PHP is and the role it plays in the WordPress platform. We’ll then share four ways to check what version of PHP you’re currently running. Let’s get started! 

An Introduction to PHP (And What It Means for WordPress)

PHP is the world’s most popular general-purpose scripting language. In fact, it’s reportedly used by around 78 percent of all the websites whose server-side programming language is known:

The W3Techs website.

As a server side language, the action takes place on the server rather than the visitor’s computer. Whenever someone lands on your site, PHP is responsible for transforming your pages into readable HTML format. PHP runs on your web server, so any issues with this programming language will impact your site’s performance

It’s impossible to overestimate the value of a fast, responsive website. A laggy site isn’t going to impress your visitors. In fact, there’s evidence to suggest that 40 percent of people will abandon your website if it takes longer than three seconds to load

Major search engines such as Google also take performance into consideration when determining where your content should appear in relevant search engine results. Today, over 53 percent of all web traffic comes from organic search. With this in mind, you’ll want to do everything in your power to impress the search engines.

When it comes to improving your site’s performance, it helps to know which version of PHP you’re currently using, and which version(s) it’s compatible with. By keeping an eye on this number, you can also ensure that this crucial component is up to date.

New releases of PHP often include performance and compatibility improvements. If you’re lagging behind, then you may struggle to compete with websites that are running the latest version of PHP.

Why It’s Important to Run the Latest Version of PHP

Your server determines which version of PHP your site is using. In order for your WordPress website to function correctly, your hosting provider must support PHP version 5.6.2 or higher. However, this is the bare minimum. 

The official WordPress website recommends PHP version 7.4 or higher. To ensure that you’re benefiting from the latest improvements and features, it’s a good idea to run the highest available version of PHP. 

Most reputable hosts will provide access to an up-to-date version of PHP. However, newer releases may deprecate certain functions. This can cause compatibility issues with older themes and WordPress plugins. For this reason, some web hosting providers may default to older versions of PHP.

If you do decide to upgrade, then it’s smart to check that you’re running the latest version of all your themes and plugins. This reduces the chances of encountering a compatibility issue after updating your PHP.

It’s worth noting that although WordPress and PHP run side by side, they’re updated separately. Just because you’ve installed the latest version of WordPress doesn’t mean you’re using the most recent version of PHP. Similarly, if you’ve enabled auto-updates for WordPress Core, you shouldn’t assume that you’re also receiving the latest PHP updates. 

How to Check the PHP Version of Your WordPress Site (4 Methods)

Since it plays a crucial role in your site’s performance, it’s important to know exactly which version of PHP you’re running. This will help you determine whether it’s time to update. With that in mind, here are four ways to check your version of PHP. 

1. Use the WordPress Site Health Tool

Introduced in WordPress 5.1, you can use Site Health Check to scan for common security and performance issues that may be impacting your site. Conveniently, this tool also displays your version of PHP.

In the WordPress dashboard, navigate to Tools > Site Health. This tool will then automatically perform a security and performance scan, and display the results:

WordPress' Site Health tool.

This report is divided into two sections: Status and Info. In the Status tab, you’ll find recommendations for improving your site’s performance and security. You can select each item in the list in order to learn more about Site Health Check’s recommendations.

To view your version of PHP, select the Info tab. Next, scroll to Server and then click to expand:

You can check the version of PHP using Site Health.

In this section, you’ll find information about your server setup. This includes your version of PHP.

2. Check Your Hosting Control Panel

You can also check the PHP version in your hosting control panel. The panel you have access to will vary depending on your choice of web host. For example, some companies use the industry-standard cPanel, while others may supply their own bespoke hosting panel. Regardless, you should be able to find your version of PHP somewhere in this panel.

If you’re struggling to find any options explicitly labelled PHP, then we recommend checking your control panel’s documentation for more information. Alternatively, you can contact your hosting provider for assistance. 

Since it’s used by over three million websites, let’s look at how to find your version of PHP in the cPanel tool. To start, log into your hosting account and select cPanel. Next, click to expand the Software section: 

You can check the version of PHP in the cPanel dashboard.

Next, click on Select PHP Version. At the top of the subsequent screen, you should see which version of PHP you’re currently using:

The Select PHP Version tool.

As an added bonus, if you click on this dropdown you’ll see all the versions of PHP that your hosting provider supports. You can now upgrade, or even downgrade to a different version of PHP. 

3. Use a Plugin

Display PHP Version is a simple plugin that displays your current version of PHP right in the WordPress dashboard. This makes it easy to keep track of this crucial component. 

After installing and activating this plugin, select Dashboard and scroll to the At A Glance widget. This will display your version of PHP:

The Display PHP Version plugin.

You can also use this plugin to view your version of MySQL. Similar to PHP, MySQL is a core component of WordPress, as it’s the database management system that the platform uses to store and retrieve all your website’s information. 

To keep your site safe and ensure that you have access to the latest features, it’s important to keep MySQL up to date. You can check which version of MySQL you’re currently running by hovering over the PHP version label in the At A Glance widget. 

4. Create Your Own PHP File 

This approach is a bit more technical than any of the methods we’ve covered previously. However, it’s a good option if you don’t have access to a web hosting panel. 

To start, open your favorite text editor and create a new file named phpversion.php. Inside this file, add the following: 

<?php phpinfo(); ?>

You can now save the file. The next step is uploading phpversion.php to your server. You can either use your hosting provider’s File Manager, or connect to your server via a File Transfer Protocol (FTP) client such as FileZilla:

You can check the version of PHP using a client such as FileZilla.

In FileZilla, navigate to File > Site Manager. If you’re connecting to your server for the first time, then you’ll need to select New Site and assign a name to this connection. Then, enter your FTP login details and click on Connect:

The FileZilla FTP client.

If you don’t know your FTP credentials, then you’ll typically find this information in the admin tool supplied by your hosting provider. In your FTP client, navigate to /public_html, which is your site’s root directory. You can now upload your phpversion.php file. 

In your web browser, enter your domain name followed by /phpversion.php (e.g., www.example.com/version.php). Your version of PHP should now appear onscreen.

Once you’ve performed this check, it’s a good idea to delete your phpversion.php file. You can do this using your FTP client. 

Conclusion 

As a website owner, you’ll want to do everything in your power to fine-tune your site’s performance. While it’s easy to overlook, your version of PHP plays a crucial role in those all-important page loading times.

Let’s quickly recap four ways to check the PHP version in WordPress:

  1. Use the WordPress Site Health tool.
  2. Check your hosting control panel.
  3. Use a plugin, such as Display PHP Version.
  4. Create your own PHP file.

Do you have any questions about checking and changing your version of PHP? Let’s talk about them in the comments section below!

Will Morris
Author: Will Morris

Subscribe
Notify me of
guest

3 Comments
Newest
Oldest Top Rated
Inline Feedbacks
View all comments

WordPress Masterclass: The Free Beginner Website Course

Learn how to build beautiful, functional websites without writing a single line of code. Completely free—no registration required.