ThemeIM Blog Details

PHP update in WordPress: How to do it in cPanel (Step-By-Step Guide in 2022)

PHP update in WordPress

Did you know?
Over 4 out of every 10 WordPress sites are running PHP versions that NO LONGER have security updates and support.

Let that sink in.

That’s over 40% of WordPress sites.
There are over 1.3B active websites in the world. And WordPress powers 35% of those. That’s (35%x1.3B) = 455,000,000 websites.

That means (40%x455 million) = over 182 million WordPress websites are running unsupported PHP versions.

But how to do PHP update in WordPress? Why do you need to do it?
We will answer each of these questions today. And show how to perform this update step-by-step.

Stay with us.

If you want skip directly to the “updating PHP in WordPress” part, just click on number 5 item.

Let’s begin.

A little about PHP versions of WP sites

Brace yourselves. Some stats on PHP versions of WP sites coming up.
Would like to know how many of PHP versions have active security support?

Only 3.

Yes three.

And those are 8.0, 7.4 and 7.3. A little under 60% of WordPress websites are running these versions.
That means the rest (over 182 million) are running PHP with high vulnerability to cyberattack.

Astonishing fact isn’t it? That’s where our next section comes in,

But why do I need to update my PHP version?

A very important question.

There are 3 primary and several secondary benefits to updating your PHP version.
Let’s look at the 3 primary benefits first:

Performance

Every software product update comes with performance boost. PHP is no exception to that.
Let us have a look at the performance of PHP 5.6, 7.0, 7.1, 7.2, 7.3 and 7.4.

Do have a good look at the chart above. Our content creators will feel good.
The more updated your PHP version is, the faster it will deliver dynamic content of your WordPress website.

Please allow us to give you an idea of how fast the later versions are.

The PHP version 5.6, 7.0 and 7.1 have an average performance of {(137+193.25+174.98)/3} = 168.41 requests/s.
That means it will respond to about 169 requests every second.

Now lets have a look at that of PHP versions 7.2 to 8.0.

The average performance of 7.2, 7.3, 7.4 and 8.0 are {(283.27+292.07+309.47+313.01)/4} = 299.46 requests/s.
The average performance of these versions are on average (299.46/168.41)x100 = 177.82% faster.

Apologies for going all Pythagoras on you!

Security

An updated PHP version will enjoy security fixes from its community. These security fixes will help keep your WordPress site from the cyber-goons.

Have a look at the calendar below.

php security support timeframe

 

Versions 5.6 to 7.2 have already reached their end of life (they are highlighted in red on the left side).

During 2021,

  • PHP version 7.3 will receive just security fixes (shown by black arrow)
  • PHP versions 7.4 and 8.0 will receive active support (shown by blue arrows)

At the end of 2021, 7.3 will reach its life’s end.

Meaning it will not be a good idea to use it.
These active support and security fixes can be lifesavers (literally) for your website.

Moral of the story, update your WordPress PHP version and worry less about your website.

Support

PHP, like WordPress, is a community-based platform.

Which means the support you get for PHP related issues comes from the community members themselves.

If you are running an updated version of PHP, it will be easier for them to resolve your issues.

That’s because they don’t have to run hundreds of compatibility tests to find a solution.

So, it will be easier and faster for them to make you smile.

Why, then, wouldn’t you update your PHP?

So how can I check my current PHP version in WordPress?

There are several ways to check your current PHP version running on your WordPress site.

We will show you how to do it from your WP dashboard.

Step 1: Navigate to Site Health

After you log in to your WordPress site dashboard, navigate to Tools > Site Health
Just hover your mouse pointer to the “Tools” menu and the side menu will pop out.

site health in wordpress

 

This is how the “Site Health” section looks like.

site health data in wordpress

 

Step 2: Expand the “Passed tests” section

After you get on the site health section, this is what you need to do.
Click on the “Passed tests” button (marked by the long red arrow in the image above)

A menu containing server related issues will appear.
In this menu, you can find the PHP version running on your WordPress website.
It’s highlighted in green within the red box in the image above.

As we said, it’s super simple.
** There are WordPress plugins that show your PHP version in the dashboard section. Meaning you will need zero clicks. But a plugin means more lines of PHP code to your existing site codebase. With the method above, you can do it in 2 clicks. Sometimes more clicks are better for your website.

Got it. So how long does PHP update in WordPress take?

Updating your PHP version on your WordPress site can take from 2 to 4 hours.

You should know that your website may experience downtime during the update.
So, make sure you plan this update at a time of low site activity.

Now tell me how to update the PHP version on my WordPress site from cPanel.

Of course. We have covered the basics.
It’s now time for the main course.

But before that, you will need to take care of a few things.

Things to do before the PHP update

These are things you will need to do to make sure your WordPress site is ready for a PHP update.
You will need the 3 plugins below:

  1. PHP Compatibility Checker
  2. WP Staging
  3. UpdraftPlus

Here are what you will need to do before updating your PHP version:

Create a backup of your WordPress website

For this purpose, you will need the UpdraftPlus plugin. If you want to know how to do, watch this video

 

Create a local staging copy of your site

A local staging site is an exact replica of your WordPress site. It’s a really safe option to test any changes. For this purpose, you will need the WP Staging plugin. You can learn how to do it by watching the video below

Or you can see this post for moving your site from one server to another.

 

Test your local staging site thoroughly

There are 2 ways to test your WordPress staging site. One is the manual process. As the name says, you will need to manually check each plugin and page. If your site is not massive, then it will not be a problem. If that’s not the case, then the PHP Compatibility Checker plugin will help you get it done. The video below shows you how to install and use it to scan for PHP related issues.

 

Make the changes in the live site

If your local staging site is compatible with the latest version of PHP, then great. What you now have to do is make the changes you made in the staging site in your live WordPress site. These include updating the core WordPress and plugins.

 

Steps to update your WordPress PHP version from cPanel

Just follow the 2 steps below and your PHP will be updated.

Step 1: Locate the “Select PHP Version” option

After you log in to your domain hosting provider’s cPanel, locate the “select PHP version” button.
Usually, it is located in the menu under the “Software” tab (shown below).

select php version in cpanel

The dashboard of your domain hosting provider may look different. But the basic concept is the same. Whatever your provider is, you will need to locate the “PHP Version” option. If you don’t find it, contact your hosting provider’s customer support. They will make it a breeze.

Step 2: Choose the PHP version

After you click on “Select PHP Version” (shown above), click on “My domains”
Under this tab, you will see the current PHP version.

current php version in cpanel

Click on the “Native version” and you will see the list of PHP versions available.
From this drop-down list, choose the latest one.
After that, click the blue “Use PHP Selector” button on the right-hand side.

And you will be done.

PHP update in WordPress: Will It Break Your Website?

To be totally honest, it is fairly possible.
That is because every WordPress version is compatible with a specific version of PHP.

That same is true for each of your plugins since they are developed for a specific version of PHP as well.
So, what to do if it does?
Well, you can follow the steps below:

Run a PHP compatibility check

We have already shown you how to check PHP compatibility. After running a PHP compatibility check, you will get a report that will show you the plugins that are incompatible with your current PHP version.

Perhaps, they are the real culprits causing this problem.

Disable the plugins that may have caused the break

We suggest you deactivate all your plugins. Then enable them one by one. This should fix the issue.
If your website is still broken, then you can roll back to your earlier PHP version. You can do it the same way you updated the PHP version in the first place.

Read More : How to enable automatic plugin update.

Wrapping up

WordPress couldn’t it make it any clearer.
This is the reason we prepared this blog post.

We have tried to be as detailed as possible. Hope your WordPress site works smoothly with the latest PHP version.
If you know anything that can make this update easier, do tell us about it in the comments below.

themeim

ThemeIM is the ultimate hub for the most exciting blogs on themes and plugins, giving you each word with hidden insights.

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.