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 "one.com PHP scanner"
- 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 "one.com PHP scanner"
- Click one.com > Plugins in your WordPress Admin.
- Locate the one.com PHP scanner and click Install now.
- Next, click Activate.
Step 4 - Run a scan and fix potential issues
- Click PHP scanner in the menu on the left.
- Select PHP version 7.4, select "All themes and plugins", and then click Start scan.
- 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.