In this guide, we show how you can safely update PHP to the latest version, without breaking your WordPress site.
- Step 1 - Check your current PHP version
- Step 2 - Update WordPress to the newest version
- Step 3 - Install the plugin "PHP Compatibility Checker"
- Step 4 - Run a scan and fix potential issues
- Step 5 - Update PHP to the latest version
- Step 6 - Verify that your site is working as expected
Note: A PHP version generally has a lifecycle of three years, after which it should no longer be used. For more information on why it is important to update, check our guide: Why do I need to update PHP?
Step 1 - Check your current PHP version
First, you need to check what PHP version you are currently using. Please wait with updating until step 5 in this guide.
- Log in to the one.com control panel.
- Click on the Advanced settings tile and then select PHP and database settings.
- Scroll down to Update PHP version.
- Check what version you are currently using.
If you are using PHP version 7.3 or higher, then you are all good. If you have PHP 7.2, you need to update. Please continue to step 2.
Step 2 - Update WordPress to the newest version
Make sure that WordPress core and all your themes and plugins are updated to the latest version.
- Log in to your WordPress Admin.
- Click Dashboard > Updates.
- Check that you have the latest version of WordPress (core) installed and that all plugins and themes are up to date. Update if needed.
Tip: Do you wonder why it's so important to update WordPress? Check our guide: Why you should always update WordPress.
Step 3 - Install the plugin "PHP Compatibility Checker"
Note: The plugin PHP Compatibility Checker is a third party tool and not owned by One.com. It can be helpful to verify that your site is compatible with the latest PHP version, but if you have any issues or questions regarding its use, we refer you to the plugin developer team. Our support cannot help you with this.
- Go to Plugins in your WordPress Admin.
- Click Add plugin at the top of the screen.
- Search for PHP Compatibility Checker in the search field to the right.
- Install the plugin; it gets activated right away.
Step 4 - Run a scan and fix potential issues
Note: If you are using the One.com Performance Cache plugin, you need to temporarily deactivate while you run the scan. You can do this from the plugins section in WordPress Admin.
- Go to Tools in WordPress Admin and select PHP Compatibility.
- Select PHP 7.4 check the box for "Scan all plugins and themes" and click Scan site.
- Wait until the scan is finished.
- You can have three results:
- Compatible = all is good!
- Warning = it should work, but might give problems with the next PHP version.
- Error = not so good, will likely cause problems after updating.
- Fix any plugins or themes that give errors; either by updating it to a newer version or by finding an alternative plugin that has the same functionality.
Tip: We recommend that you only use plugins that get updated regularly and are compatible with the latest WordPress version. It's also good practice to remove any plugins that you don't need.
Step 5 - Update PHP to the latest version
You are now ready to update PHP. We also recommend to turn on PHP error messages at the same time. If there is an issue with the code, error messages tell you what is causing it and where it is located.
- Go back to PHP and database settings in the One.com control panel.
- Scroll down to PHP error messages.
- Set the error messages to On and click Update.
- Directly below this, please change the version to 7.4 and click Update.
Tip: You can also choose to update PHP to "the latest stable version". Then we will automatically update PHP for you. Check out guide for more information: What is the latest stable PHP version?
Step 6 - Verify that your site is working as expected
After you have updated the PHP version, it will take at least 20 minutes before the changes are in effect. If you have a site with a lot of visitors, it can easily take several hours. That's why we recommend checking your site a couple of times during the next 24 hours.
If your site isn't working as expected, then the most likely culprit is a plugin or theme. To find out which one is causing problems:
- Temporarily switch to a default WordPress theme, like "Twenty Seventeen".
- Deactivate all installed plugins.
- Enable all plugins and themes again, one by one, checking each time if your site is still working.
If you can't access WordPress Admin, then you can deactivate plugins and themes from the database. Check the guides below.
You are always welcome to contact us for more information. Our support can help you to find out what is wrong, however, please keep in mind that we cannot fix the code for you. This you need to do yourself.