If you are a WordPress user, then you probably know that the recent version of WordPress requires PHP to be at least PHP 7.4 due to security reason. It is important for your website to be running on the latest release of PHP so that all plugins and themes will function properly. In this blog post, we will walk through updating WordPress and everything it needs to run successfully with the newest version of PHP.
Table of Contents
Why Do You Need to Update PHP?
One of the benefits of updating to PHP 7.4 or higher is that it will ensure all your plugins and themes are compatible with the latest version. This also helps in security, as WordPress uses a lot of extensibility points for plugin developers to add new functionality into their work.
When they do so, there needs to be compatibility between what is being added and the version of PHP that WordPress is on. This ensures that new code will not break your website while it operates.
Another benefit is faster speed! PHP is a language that handles many aspects of WordPress including caching and loading. The higher level the version, the faster your website will load for users.
Things to Do Before Updating the PHP
Review plugins and themes for compatibility with the latest version of PHP
Because there are different options to choose from, it is best to test the compatibility of your WordPress set-up before you update. For example, if you have a PHP plug-in that brings new functionality and tries to use it after installing the latest version of PHP, then one may encounter technical issues with the plugin.
Create a backup of your website
Fortunately, you can always revert to the original or previous version if an update does not go as expected. That’s why storing a backup of your website is important before any updating process.
Nonetheless, it is a good idea to use a backup solution and make sure that all of your data (including other sites) are backed up before proceeding with the update.
Delete unused plugins
It’s best to delete any unused plug-ins or tools from your WordPress dashboard. This will result in a faster loading time and minimized input time. And it can help avoid any unexpected errors coming from these plugins.
How Do I Update?
Depending on your hosting and the software used to manage a web server, you need to follow different approaches to update PHP.
Hosting with a Web Control Panel
If you server is using a web control panel like cPanel or Virtualmin, you are in luck. The process of updating is easy as you can use their user-friendly interfaces to update PHP and choose which PHP version to use for which websites.
cPanel is a Linux-based web hosting control panel. It is used for managing and maintaining applications on the server. It is very user-friendly and comes with a lot of helpful features. cPanel is the industry standard for manage web hosting.
The following steps use cPanel as reference. The tasks on other web control panels are similar.
- Log into the Control Panel.
- Find Select PHP version software. This software allows you to see the current version of the PHP.
- Pick the most recent PHP version: 7.4 or 8.0.
Most self-managed servers don’t have a web control panel installed becasue the owner don’t want a software that eat lots of resources on their servers and don’t want to pay a premium price for that kind of software.
If you install a free web panel like ISPConfig or Virtualmin on your server, you can follow the same steps above to update PHP.
If your server is vanilla, you can read my other post about how to update PHP on Ubuntu and Debian.
What to Do After Updating PHP Versions?
After updating a PHP version, you need to update both WordPress core files as well as all plugins within it to new versions without having any compatibility issues with security or speed!
Before we start, it is important to understand that this process will require a manual update. This means you have the ability to know what plugin was updated and when, as well as WordPress core files being changed.
To start off, we will need to download all plugins with an outdated version of PHP in order for them to be compatible with the newer release of PHP.
The next step is to update WordPress core files and all plugins that are not in use for any reason, including ones you may have disabled or deleted from your site. When updating the newest versions of Core Files, it will automatically download all new updates for plugins as well!
If you find yourself with a plugin conflict after this process is complete, we recommend checking out the official WordPress Support page. This will help you troubleshoot any issues that may be occurring with your website and how to fix them!