Updating the PHP Version for Your WordPress Website

PHP logo over some PHP code and update progress bar

Updated:

|

Published:

Updating your WordPress website to a recent PHP version is important to ensure that your site loads fast and is as secure as possible. In this article we’ll briefly explain what PHP is and how to easily check your PHP version in WordPress and update it in cPanel and DirectAdmin.

If you’ve been seeing the warning message below in your WordPress dashboard, it means the server your website is hosted on uses an older version of PHP. Your hosting provider sets the PHP version for your website at server-level and there is unfortunately no way to change the PHP version from the WordPress admin dashboard.

The PHP Update Required Error Message

What is PHP?

PHP is short for Hypertext Preprocessor, it is a server side scripting language that is widely used in website development. Server side means that processing happens on the web server before anything is displayed in your browser. Server side scripting is usually hidden from the end user and you won’t see any PHP code in your browser.

WordPress is built on PHP and the core, themes and plugins use it extensively. You don’t need know PHP to use WordPress but you will need to make sure that your website uses a recent version of the software. This is important for the security and performance of your site.

How to Check Which PHP Version Your Website is Using

Before the Site Health tool was introduced in WordPress 5.2, a separate plugin was required to check the PHP version of your website. If the Site Health tool isn’t available, the chances are that your website uses an older version of WordPress. We strongly recommend that you update to the latest version (currently version 6.2).

You can check the PHP version your website is using in the WordPress admin dashboard by hovering over Tools and selecting Site Health.

WordPress Site Health Tool

If your website uses an older version of PHP you’ll see something like the following in Site Health:-

WordPress Site Health Status with 1 Recommended Improvement.

For more information about your WordPress installation, click on the Info tab at the top of the Site Health screen.

Selecting the Info Tab in WordPress Site Health

For information about the PHP version, you need to scroll down to and expand the Server section. Here you’ll see details about the hosting server and the PHP version your website uses.

Checking the PHP version in WordPress Site Health - Info.

WordPress and Compatible PHP Versions

At the time of writing this article, the latest version of PHP is version 8.1 and WordPress recommends a minimum of PHP version 7.4

WordPress will work with PHP versions as far back as version 5.6 but it’s important to note that all versions prior to PHP 7.4 are end of life (EOL). This means that they no longer receive updates and can leave your website exposed to security vulnerabilities.

Why You Need to Update Your WordPress PHP Version

Security

PHP like WordPress is Open Source software which means anyone can study the source code to learn and improve it. This unfortunately also allows hackers to study the code and look for ways to break into websites. There are luckily thousands of developers and security experts who study the source code and report weaknesses and security bugs.

What is Open Source Software?

The term open source refers to something people can modify and share because its design is publicly accessible.

The term originated in the context of software development to designate a specific approach to creating computer programs. Today, however, “open source” designates a broader set of values—what we call “the open source way.” Open source projects, products, or initiatives embrace and celebrate principles of open exchange, collaborative participation, rapid prototyping, transparency, meritocracy, and community-oriented development.

www.opensource.com

When security vulnerabilities are reported, development teams work on the necessary security upgrades to correct the problems. If you don’t update and continue to use older and deprecated versions, you won’t get the benefits of these upgrades.

Speed and Performance

Updating your PHP version can provide a 3 to 4 times increase in the performance and speed of your website. Google uses page load speed as an important ranking factor, so a faster loading website has SEO benefits and can help you rank higher in Google search results.

Compatibility

Updating your WordPress PHP version will ensure that your website is compatible with new WordPress core updates. Theme and plugin developers also introduce new features and functionality that are only available in the newer versions of PHP.

If you don’t update your PHP version you may find that WordPress core, theme and plugin updates no longer work on your website. This means that you won’t be able to take advantage any new features and functionality.

Before You Update Your WordPress PHP Version

If you’re using the latest version of WordPress and updated your themes and plugins when necessary you shouldn’t experience any problems after updating the PHP version. It is advisable however to test your website in a staging environment before updating your live site. This will prevent possible downtime if there are problems for any any reason.

The problems WordPress users experience after updating their websites PHP version are usually caused by themes and plugins that have not been updated by the developers for some time. In a staging environment you can test problematic themes and plugins. If there aren’t updates available you should reach out to the developer or look for alternatives.

If you are unsure of anything it’s also advisable to reach out to your website hosting provider or a professional web developer for help.

Backup Your Website

Making regular backups of your WordPress website should be part of your routine. If you don’t already have a backup system in place, now is a good time to get one. There are many backup plugins available for WordPress like BackupBuddy, All-in-One WP Migration and UpdraftPlus. You’ll find more in the WordPress Plugin Repository.

A backup will ensure that you can restore your website in case something goes wrong.

Update Your Version of WordPress

Keeping your website updated with the latest version of WordPress helps to protect your site from hackers. You’ll also benefit from the new features and improvements that come with the latest version.

For more on updating WordPress, see our article on How to Manually Update to the Latest Version of WordPress.

Update Your Themes and Plugins

Since we’ve updated WordPress to the latest version, it’s important to update all your themes and plugins. This will help to ensure compatibility with the new versions of WordPress and PHP.

How to Update the PHP Version in your Hosting Account Control Panel

In order to update your version of PHP, you’ll normally have to log into your hosting account control panel. We’ve used cPanel in this example as it’s used for many shared hosting accounts.

Updating Your WordPress PHP Version in cPanel

If your hosting account uses cPanel, you can check and update the PHP version like this:-

Select PHP Version in cPanel
  1. Log into your cPanel and scroll down to the Software section. Click on Select PHP Version.
  2. You’ll be presented with the current PHP version your website uses and a list of versions your hosting provider supports.
  3. Select the version you want to use (in this case we selected version 7.4) and set to current.
  4. You’ll need to wait a few minutes while the server updates to the new version. You can go back into WordPress once it’s updated.
Change the PHP Version in cPanel

How to Change Your PHP Version in DirectAdmin

Changing the PHP version for your website is also fairly simple if your hosting account uses DirectAdmin. Here’s how to dot it:-

  1. Log in to your DirectAdmin account.
  2. Navigate to Account Manager > Domain Setup.
  3. Select the domain where you want to change the PHP version.
  4. Click on the top PHP Version Selector link and choose the PHP version you want from the list.
  5. Click the save button and you’ll see a confirmation message “PHP version saved“. You may need to wait for a minute or two while the change is effected.
Changing the PHP version in DirectAdmin

What if You Don’t Have Access to cPanel or DirectAdmin?

Your hosting account may use a different admin control panel like Plesk or their own custom account control panel, but changing your PHP version should still be similar to the methods we used above. If you need help, you should reach out to your hosting company as they may have specific instructions.

Summary

Updating the PHP version your website uses is important for both speed and security. It’s also critical for receiving future WordPress core, theme and plugin updates.

I hope this article has helped explain a little about why you need to update your WordPress PHP version. If you need help updating PHP or your WordPress website, please feel free to contact us. We’re always happy to help. Visit our home and services pages for more about us and what we do.

Cimeron Collins

Cimeron Collins

Cimeron is an artist and designer with more than 30 years experience in the printing and publishing industries.

He is an avid WordPress enthusiast and passionate about learning and experimenting with new developments and technology in website design and development.

He lives in Edenvale, South Africa with his wife Tamay.

Please share this article if you found it useful

Leave a Reply

Your email address will not be published. Required fields are marked *

Top