WordPress PHP Update Solution

Solution: WordPress PHP Update Recommended

If you’ve been using the same installation of WordPress for a while, you may have recently noticed a new notice pop up when you log into WordPress Admin

WordPress PHP Update Notice
Is this bad? It’s bad, right?

If you click the big blue button you get taken to a WordPress.org article that does a pretty good job of explaining what this notice means, and what you should do about it, but there’s one important step in that article where they can’t really tell you exactly how to actually change the PHP version.

This article will closely mirror the official one but with some useful additions for anyone using a cPanel hosting server.

Why Does this Matter?

The most important reason is security. Newer PHP versions are not just newer, they also have security fixes that older PHP versions may have left in them, which means being on a newer PHP version will make it just that bit harder for hackers to compromise your website.

If your hosting server uses Cloudlinux (with it’s selector) or Imunfiy360 (With hardened-PHP enabled) then your server is mostly protected from vulnerabilities with older versions of PHP, but unless your site requires an older PHP updating PHP is still recommended.

On top of that, newer PHP versions are almost always faster. Not *much* faster, but when it comes to SEO sometimes every little bit helps.

Finally, depending on how old your current PHP version is, there may be plugins you want to try installing in the future that will require a more updated PHP in order to even work at all.

Before You Start

There’s a couple things you should do before changing PHP versions.

  • Back up your website. WordPress has a few plugins you can use to do this, but you can also always just use FTP and cPanel’s ‘phpmyadmin’ tool to make a manual backup copy of the whole website folder and database. Instructions for that can be found in our Knowledgebase article here.
  • Once you’ve made your backup, Update WordPress, your themes, and your plugins, in that order. Check each step to make sure the update didn’t break anything on your site. If something breaks, you have that backup!
  • Check PHP compatibility using this plugin. It’s not perfect but it will catch almost all version conflicts before they happen which will give you a chance to address the issue before your site fails. Keep in mind, this tool may miss conflicts, and may also spot a conflict that doesn’t actually exist.
  • Make a note of your current working PHP version. Just in case you have to switch it back.

Update your PHP Version

If you’re not using a cPanel hosting server, you will need to ask your host what the exact steps are to change your PHP version.

PHP Version

If you are using cPanel, then log in, and head down to the ‘Software’ section of the cPanel tools menu You should find at least one of these two icons shown to the right.

Select PHP Version

This is the PHP selector provided by CloudLinux servers. This selector tends to give you better control over your PHP extensions, but at the time of this writing, cPanel only lets you select one PHP version to use for all your sites on the account. If you have more than one website installed, you will need to check *all* of them whenever you change this setting.

On the ‘Extensions’ Tab of this selector, you can pick your ‘Current PHP Version’ from a drop-down, and then click ‘Apply’.

Current PHP Version

Once you click Apply the change is immediate.

MultiPHP Manager

This is the PHP Selector native to cPanel servers. It will let you control your PHP version by domain so you’ll need to select the domain you want to change the PHP version for, and then pick your PHP version, and apply it.

Like the other option, changes applied here are immediate.

Both Selectors?

If you have both selectors then you can choose which one you want to use, but usually our recommendation is to stick with the ‘Select PHP Version’ route. If you have questions about how these two selectors interact, you will need to speak with your hosting provider for more detailed instructions.

Did it Work?

That’s an important question! After changing your PHP version you should immediately check your websites on that domain (or if you’re using the ‘Select PHP Version’ system, all of your websites.

Yes, Everything Seems Fine…

Great! Keep an eye on your sites for a while, just to make sure nothing ambushes you, but you’re probably in the clear! Usually when an error occurs due to a PHP version issue the result is instant, and very very obvious.

Uhh, No. It broke.

The way it can break can be varied. You may see a blank white page, or you could see a “WordPress Critical Error” Prompt on your site. Do not panic! This kind of failure is very easy to undo!

Just go back into your php selector, the same one you used to change the PHP version, and put it back to what it was before you changed it, apply your settings, and wait a few seconds. Your website should spring back up as if nothing went wrong.

Also, the error probably left clues! You may need to speak with your web developer if you don’t know where to find the ‘error_log’ files, but when PHP breaks like this, it writes to that file, and it often has a very detailed report that tells you (or your developer) which WordPress Plugin or WordPress Theme didn’t like your PHP version.

Armed with that info you can either ask the provider of that plugin if they have an update compatible with your new PHP, or start looking for a replacement plugin that is compatible.

Sometimes you’ll run into problems jumping over too many PHP versions. If you’re on PHP 7.2 and you want to upgrade to PHP 8.3, and it doesn’t work, try going up one version at a time. This will give you an idea regarding exactly which PHP version update starts causing your error.

Final Notes

Here at HostUpon, We recently updated the default PHP version for all new shared hosting accounts to PHP 8.3, which meets the requirements for current WordPress installations so you shouldn’t see this warning.

If you’ve been using our services for a while, you may be on an older version, so these instructions should work for you, but if you have any questions feel free to contact our support!

And as the WordPress article also says:

Thanks for making the internet a better place!

Add comment