If you want your blog, your website or your Online Store works normally, it would be ideal to consider changing or updating the PHP version you are using on your website. The new version of PHP (PHP7) is not yet widespread enough, but it will not be long in coming, because it brings a lot of new features and it is very likely that it will be required for the installation or the use of the next versions of WordPress. 

This article assumes that you have already created a website or WordPress blog. Otherwise, see this detailed guide.

But if you have already done so, let's continue.  

Why should you upgrade to PHP 7?

If you use WordPress on your server, you obviously have PHP already installed. So, why upgrade when everything seems to work so well?

Here are some of the most common reasons why you should consider upgrading your version of PHP:

  • The plugins and scripts that you have installed are no longer compatible with the version you are using
  • The minimum requirements to run WordPress have increased
  • The version you are using has security flaws and the upgrade includes a patch
  • You need to migrate towards a more stable version
  • You want to test a different version on a WordPress installation or on a test environment
  • You have found conflicts between the version you are using and the plugins, themes, or scripts that you have installed

Have you ever thought about protecting your blog or website? here is Some tips to secure your WordPress blog

These are all valid reasons, but before you go ahead and update your version of PHP, there are some downsides to upgrading that you should consider ...

Some important drawbacks to take into consideration ...

Switching to a newer version of PHP has some risks. Here's a very WordPress Plugin premium that will back up your entire website and restore it in the event of a failure.

The main thing that you need to keep in mind before you upgrade is that all your plugins, themes and scripts are not necessarily compatible with the latest version of PHP you want to use

In the event of incompatibility, it is very likely that your website is no longer usable or that you notice many bugs. Moreover, WordPress now tells you if a plugin is compatible with your version of PHP or not.

How to modify php wordpress update

Each version of PHP offers new variations, improvements and possible fixes, security fixes and code structure. While some updates are less complete than others, many versions offer improvements or changes that make parts of older versions obsolete.

See also Some WordPress security plugins for your blog

In some cases, whole versions such as PHP 4 and above are no longer supported. If you use plugins, themes, or scripts on your website that depend on outdated PHP code and upgrade to a newer version of PHP, this upgrade will make the code obsolete and thus break the operation. of your blog.

Although it is not to always the case, it is important to realize that the changes you bring will have consequences. In this way, you can consider the different compatibility issues. But if you need a premium WordPress theme that will always be up to date check out the following list depending on your niche.

In addition to manually checking your website for possible weak points, there are many plugins that will let you know whether or not your environment is compatible with the upgrade. The good news, in fact, is that you can downgrade the previously activated version. In other words, if you notice any bugs, it is always possible to restore the previous version of PHP ... so switch from version 5.5 to version 7.x for example and if everything does not work well, you can go back to version 5.5.

Check PHP compatibility

Here are some plugins that you can use to check the compatibility of your environment with an updated version of PHP:

  • Compatibility Checker PHP  - This plugin allows you to define a version of PHP and to make an analysis compared to the current version of PHP of your host. It also creates a report, to tell you what to fix.
  • Error Log Monitor   - If there are any errors, you can enable a log to keep track of all the errors, which will help you to fix them more easily.

You can also activate manually un journal private error using " WP_DEBUG ". You can also see what has changed for each version of PHP before the upgrade:

If you find that you are using a plugin, theme, or script that is not compatible with the version of PHP you want to use, you can contact the author or developer to help you resolve the issue. If you need a helping hand, you can leave a comment in this article, I will be happy to provide answers.

How to change the PHP version

So, once your blog has passed the compatibility test, you can change the version of PHP you are using via SSH or cPanel. If this is not an option to which you have access, contact your web host. In most cases, they can update for you or perform other tasks.

Upgrade via SSH (advanced users)

Since the SSH commands for upgrading or installing other versions of PHP are different depending on the type of server, then there are no universal commands that work everywhere.

Protect your blog or website by consulting our tutorial: Sucuri: An effective tool to protect against attacks on WordPress

Click on any of the resources below to view details based on your server type:

Keep in mind that if you are using the commands provided in these links, you must also remove the old PHP package from your server. Since the commands to remove older versions will also vary depending on your server type, consult your server's documentation for the exact commands.

Update or change PHP in the cPanel

If you prefer to choose In a few clicks a version of PHP for your server, you can do this by logging into your cPanel account. However, this option is only available in default versions of cPanel. If this is not the case for you, you will need to contact your supplier.Web hosting for it.

I'll show you how to access it from your cPanel. Once you are connected, go to the "Software" section and then click on "MultiPHP Manager".

Cpanel software

By clicking on it, you will come to the PHP version management for the different domains & subdomains available. All you have to do is choose the right version of PHP and apply it to the domain of your choice.

Domain cpanel php version

The procedure can be done in 3 simple steps as in the following image:

Choose the php version on a domain

You will notice that the interface will be similar to the one offered by the WHM (if you have a dedicated server).

How to edit from the WHM

If you have a server, you probably have a WHM installation, which allows you to manage your server. From the WHM, you can also change the version by default of PHP on your cPanel. You just need to go to MultiPHP Manager and change the version of PHP you want to use on each domain.

Change the version of php whm

The version backup is done automatically when you change version.

Recommended Resources

To go further, we will recommend some articles that will help you understand how having an updated php version is important.

Conclusion

That's about all you can do to update your version of PHP. If you have any questions, feel free to leave them in the comment section. You can also discover additional resources by going to this page.

And if you liked this article, share it on your different social networks.