How to Check And Update PHP Version in WordPress

Itโ€™s critical to update and have the latest version of PHP installed on your WordPress site for overall speed and performance.

As a website owner you donโ€™t need to know PHP but you do have to check and update PHP version on your WordPress site to make sure that you are running an updated version. This is because hackers and malware can exploit outdated versions of PHP to hack into sites.

In this article we will guide you on how to check and update PHP version on your WordPress host and also check what PHP version is currently running and determine whether it may be time to update to a newer version.

Traditionally, you can use a plugin such as Display PHP Version or PHP Compatibility Checker to check a WordPress PHP version check.

But, plugins are known to slow down page load speed, if we can it’s best to avoid that one extra plugin.

How to Check Your PHP Version in WordPress

There are a handful of other methods you can use. here are three ways to check your PHP version in WordPress

:: Check-in WordPress Site Health Tool from Your Dashboard
:: Check-In Your Hosting Control Panel (cPanel)
:: Create and Upload a PHP File to Your WordPress Directory

1. WordPress Site Health Tool from Your Dashboard

This is the quickest and easiest way to check your PHP version in WordPress is to do so directly from your dashboard. First, navigate to Tools > Site Health

check and update PHP version

On this page, you can view the site health status of your WordPress site as well as any available updates or recommended improvements. Your site’s PHP version will also be listed here. Select the Info tab

wordpress site health

Next, click on the arrow to expand the Server section. This will provide you with a handful of details regarding your server setup, including your PHP version

site health php version checker

If, for some reason, youโ€™re unable to access your admin dashboard, locked out donโ€™t worry. There are two other methods you can use.

2. Check and update PHP In Your Hosting Control Panel

Another way you can check your WordPress PHP version is through your hosting control panel. This is a simple, safe, and quick method.

Most hosting providers will list your PHP version somewhere in your control panel. If itโ€™s not clearly labeled, you may just need to refer to the specific documentation of your web host.

If your hosting provider uses cPanel, log in to your cPanel and open it. Under the Software section, look for PHP Version or MultiPHP manager and click on it. Depending on your hosting provider it could be different but similar.

check and update PHP version

At the top of the page that opens, you should see which PHP version youโ€™re currently using

check and update PHP version

If you click on the drop-down button, it will show a list of PHP versions your hosting provider supports.

This is where you can select the latest version of PHP your hosting provider supports and update your site’s PHP version

In case you missed: How to Choose the Best WordPress Hosting Provider

3. Create and Upload a PHP File to Your WordPress Directory

The above two methods are the best and easiest way to check the PHP version of the WordPress site. The third method is a bit technical and should be used as a last resort.

You should use this method only if you don’t have access to your WordPress admin dashboard, and have no access to your site’s cPanel.

First, open your text editor (such as Notepad) and create a new file named phpversion.php. In that text file, type the following line of code:

<?php phpinfo(); ?>

Save the file as phpversion.php. Make sure the file extension is .php.

Next, connect to your server using File Transfer Protocol (FTP) via an FTP client. You can also use your hostโ€™s File Manager.

Upload this text file in the root directory of your WordPress site (/public_html).

After the file is uploaded, log out of your cPanel.

Open your web browser and type “www.yourwebsitedomain.com/phpversion.php into the address bar. ( replace โ€˜yourwebsitedomain.comโ€™ with your actual WordPress site URL.) then press enter

This will open a window that displays detailed information about your PHP version, note down the PHP version.

For security purposes, it’s recommended to delete the phpversion.php file from your directory once youโ€™re done.

Check out: How To Configure Entity Tags (eTags)|Speed Up WordPress

Conclusion

PHP is a crucial part of your WordPress website for security and helps it run properly and for overall site performance. Itโ€™s highly recommended that your WordPress site runs on the latest version of PHP available.