All Kinsta clients can easily choose the PHP version for a WordPress site within the MyKinsta dashboard. We recommend using the latest available version of PHP supported by your WordPress installation.

As you may have heard, PHP has moved to a predictable release schedule. Each new version is actively maintained for two years and receives an additional year of critical security updates. To make sure your WordPress sites are as fast and secure as possible, we have adopted the same schedule, which means that we will be removing unsupported versions of PHP when they reach end-of-life (EOL).

Why Update the PHP Version of Your WordPress Site?

The two main reasons for updating the version of PHP running behind your site are security and speed.

Just as you upgrade WordPress itself to make sure you are protected against security vulnerabilities, you should do the same with PHP. In addition, upgrading PHP generally results in a significant speed increase, as our PHP benchmark reports show.

For additional details, check out our article on supported PHP versions.

Not sure what version of PHP you’re running? You can check in the MyKinsta dashboard Tools menu. Or, you can see the PHP version using the WordPress Site Health tool:

Screenshot displaying the PHP version in the WordPress site health tool.
Checking the PHP version in the WordPress site health tool.

What If My Site Breaks?

Issues caused by updating PHP versions happen when code running on your site uses old functions that are no longer supported by newer versions of PHP. The culprit is likely to be a plugin or an active theme. Our guide below contains step-by-step instructions on how to troubleshoot this.

How to Update PHP Versions in WordPress

Today we’ll walk you through the steps on how to best test your WordPress site for compatibility before updating PHP versions. Many of you shouldn’t experience any downtime, and there will be little work required.

For others, additional testing, troubleshooting, and even hiring a WordPress developer to make things compatible might be required.

If you simply want to update the PHP version on your live WordPress environment right away, you can skip down to Step 5. However, we strongly recommend following all of the steps below though to ensure everything works properly.

Especially if you’re running an older version, such as PHP 7.4.

  1. Create a Staging Site
  2. Change PHP Engine
  3. Test Site, Plugins, Theme
  4. Push Staging to Live
  5. Update PHP on Live Site

Step 1 – Create a Staging Site

The first thing you should do is create a staging site. This is separate from your live environment and will allow you to test newer versions of PHP without breaking your live site.

In the MyKinsta dashboard, click on WordPress Sites in the left navigation. You will see a list of your sites. Click on the one for which you want to change the PHP version. Next, click on the environment selector next to the site name, and select the Create New Environment option.

Screenshot showing the creation of a new site environment in MyKinsta.
Creating a new site environment in MyKinsta.

From here, follow the steps in our documentation for creating a Standard WordPress Stating Environment.

Make sure to also check out the important notes regarding staging environments. For example, if you’re using a third-party CDN, you might need to disable it for your site to render correctly.

This is because your staging site uses a different URL. Caching is also disabled on staging, so please keep this in mind if you are trying to test performance.

Step 2 – Update PHP Version for WordPress

To update your WordPress site’s PHP version, go to Sites and select the site for which you’d like to change the PHP version. Next, click on the Tools tab. Under PHP Engine, click on the Modify button and select your preferred PHP version in the drop-down menu.

If you want to test a new PHP version first, make sure your WordPress staging environment is selected, not your live environment. We recommend first testing with a version of PHP one step up from your current installation. If your site has problems, you can contact our Kinsta support team at any time.

Screenshot showing the PHP Engine tool in MyKinsta.
Selecting a PHP version in MyKinsta’s PHP Engine tool.

Once you select the PHP version you want, you’ll get a confirmation prompt. Click on the Modify PHP version button to confirm your choice.

Screenshot of the confirmation prompt in MyKinsta for modifying the PHP version.
Confirmation: Modify PHP version.

This process may take up to three minutes. At the end of the process, your PHP engine will be restarted, which may result in a couple of seconds of downtime for your WordPress backend only. Your site visitors will not experience any downtime.

While the PHP version is being changed, you can navigate away from the above page, but some actions like cache management will be unavailable until the new engine has been activated. You will receive a notification in the dashboard as soon as the change has been made.

(Suggested: Changing your PHP version can help you fix “The site is experiencing technical difficulties.” error in WordPress).

Step 3 – Test Your Site, Plugins, Theme

You should now have a staging site up and running on the latest version of PHP (or the version you want to switch to). The first thing you should do is simply browse and click around on your WordPress site to see if you notice anything broken.

If something is incompatible, such as a plugin or your theme, you might see a 500 error (501502503504, etc.) or white screen of death on the front-end of your site. In this case, the easiest and quickest way to determine what might be causing it is to disable all of your third-party plugins and re-enable them one by one. Remember, you’re on a staging site. So you don’t have to worry about breaking anything.

In your WordPress dashboard, under the Plugins screen, select all of your plugins. Then select Deactivate from the Bulk Actions drop-down and click Apply.

Screenshot of the WordPress plugins page and the Bulk Actions drop-down menu,
How to bulk disable WordPress plugins from the dashboard.

You can then re-enable them one by one, visiting your WordPress site each time. This will help narrow down what might be causing an issue. Don’t have access to your WordPress dashboard because of an error? No problem, check out how to disable plugins via FTP.

The exact same tests can be used with your WordPress theme. You can temporarily switch back to the default WordPress theme, such as the Twenty Nineteen theme.

View Log Files in MyKinsta

Perhaps you have determined which plugin or theme is causing the issue but are not sure why? This is where your WordPress error logs can come in handy. Simply click into one of your WordPress sites, and on the right-hand side, click on Error Logs.

You can view your error.log, kinsta-cache-perf.log, and access.log files. By default, it will show the last 1,000 lines. You can use the line-count drop-down to select a larger amount (up to 20,000 lines).

Screenshot of the MyKinsta Log viewer.
The error.log file in MyKinsta Log viewer.

Important: The MyKinsta logs tool doesn’t show debug info. If you need to view debug information, you can enable WP_DEBUG as we’ll show you below.

View Raw Log Files via SFTP

You can see the completely unmodified logs in /logs/ via SFTP.

WordPress error logs folder via SFTP
WordPress error logs folder via SFTP

Tail Your Log Files via SSH

You can tail the logs while you experiment on your site using SSH. This basically means you can watch the log update live while testing. All of Kinsta’s hosting plans include SSH access.

Show last 500 lines

tail -n 500 /www/sitename/logs/error.log

Watch the file live

Watch your error log file update on the fly.

tail -f /www/sitename/logs/error.log

For those of you with SSH access, WP-CLI can also be an invaluable tool.

Enable Debug Mode in MyKinsta

For Kinsta users, WordPress debug mode can be enabled right in the MyKinsta dashboard. Simply navigate to WordPress site and environment for which you want to enable debugging. Click Tools on the left menu and then click the Enable button on the WordPress Debugging tool. This will allow you to see PHP errors and notices without having to enable debug mode via SSH or SFTP.

Screenshot showing the WordPress Debugging tool in MyKinsta.
Enable WordPress debug mode in MyKinsta.

Our self-healing PHP feature automatically restarts PHP if it notices any issues. If you need to manually restart PHP for any reason, you can do so by going to your site’s Tools page and clicking Restart PHP.

Screenshot of the Restart PHP tool in MyKinsta.
Restart PHP in MyKinsta.

Enable Debug Logging in WordPress

If you don’t have SSH or MyKinsta access, you can always enable debug logging in WordPress. First, you will need to connect to your site via SFTP. Then download your wp-config.php so you can edit it.

Download wp-config.php file
Download wp-config.php file

Find the line that says /* That's all, stop editing! Happy blogging. */ , and just before it, add the following (as seen below):

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Enable debug logging in WordPress
Enable debug logging in WordPress

If the above code already exists in your wp-config.php file but is set to “false,” simply change it to “true.” This will enable debug mode and show everything in your /wp-content/debug.log file. You will also see warnings and errors in your WordPress admin if they exist.

Important: Don’t forget to turn it off when you’re done, as these files can get pretty huge very quickly.

Confused as to What to Look For?

There are thousands of plugins and themes out there, so, unfortunately, it’s impossible for us to list all the errors you might experience. Typically these occur due to code (functions, syntax, etc.) being incompatible with the version of PHP you’re using. However, here is an example of something you might see.

500: Fatal error: Uncaught Error: A semicolon (';') is expected here. in /www/sitename/public/wp-content/plugins/bbpress-shortcodes/bbpress-shortcodes.php:177

As you can see above, it’s pretty easy to quickly narrow down that it’s the bbPress Shortcodes plugin causing a problem.

In worst-case scenarios, you might find that you have a compatibility issue with one or two plugins. If that is the case, here is what we advise:

  1. Update your plugins and themes to the latest version if you haven’t already.
  2. Reach out to the developer of the plugin or theme and ask them to add/fix support PHP 7.4 (or the current version you’re using). This is one reason we’re giving you a heads up before the phase-out dates!
  3. Find an alternative plugin that can deliver the same functionality and is compatible with the PHP version.
  4. Hire a WordPress developer to fix the issue.
  5. Change your PHP engine to a lower version and see if the plugin or theme then works. If it does, you could run on a lower version of PHP until the developer updates their code. We don’t recommend this as PHP 8.0 is faster and will remain supported for a longer period of time. But if there is something you absolutely need to run and it only works on PHP 7.4, then you might have to resort to this.

Step 4 – Push Staging to Live

Once you have finished testing your site with PHP, if you had to make any changes to your plugins or themes, you can either push staging to live or make the same changes to the live site that you made to the staging site.

Some of you may find that you have to make fairly exhaustive changes in staging to get the site running on a newer version of PHP. In that case, using the push to live feature will save you a lot of time.

To do this, make sure you have your staging environment selected. Then click the Push Environment button.

Screenshot showing the MyKinsta Push Environment feature in use.
Push Staging to Live in MyKinsta with Selective Push.

Feel free to reach out to our support team 24/7 regarding concerns or issues with updating the PHP version on your WordPress site.

Step 5 – Update PHP on Your Live Site

Now that it’s ready for PHP to be updated, you can change the PHP version on your live site just as you did in Step 2 above (Tools > PHP Engine > Modify > select your preferred PHP version).