Test PHP 7 Upgrades on a WordPress Staging Site
WordPress recommends that you use PHP version 7 or higher. However, the vast majority of web hosts put your site on version 5.x by default. That means you probably need to update your site to PHP 7. In this post, I’ll talk about why and how to upgrade, and how to make sure the process goes smoothly, with no downtime on your site.
What is PHP?
PHP is the programming language that WordPress and many of other CMSs are written in. PHP is very handy for developers, because it can take information from a database and display it on a web page. PHP has been around for a really long time (it is ancient in internet years) and it evolves as the Internet evolves. New versions of PHP are released on a regular basis (or not so regular, since version 6 never made it off the ground and they skipped from 5.6 to 7). Updated versions of the language provide new tools for developers, as well as security improvements for the web as a whole.
Why should I upgrade?
The WordPress team strongly recommends that you use PHP 7 or higher. Your site will run faster and be more secure from hackers. More and more plugins use features that are only available with PHP 7, so there are a lot of plugins that won’t work with earlier versions. WordPress development is held back by so many websites being on old versions of PHP. If most users upgrade, then WordPress can use more of the latest PHP functions to become more robust and build new features.
How do I upgrade my WordPress site to PHP 7?
How you can upgrade your site to PHP 7 depends on your web host. Some web hosts let you select your PHP version in cPanel. Some web hosts require you to open a support ticket so they can upgrade your site for you. Some web hosts might not offer PHP 7, in which case you might need to move to a different web host.
Will upgrading to PHP 7 break my site?
It is possible that upgrading your PHP version will cause some problems on your site, particularly if you are using a theme or plugins that have not been updated in a long time. As long as you have the latest version of WordPress, and as long as your theme and plugins have been updated recently, upgrading is probably safe. Most sites will be able to upgrade to PHP 7 without a problem. However, if there is code on your site that is not compatible with PHP 7, you will might get a white screen of death or see broken pages on your site when you upgrade.
How can I test a PHP 7 upgrade on WordPress?
If you want to test whether your WordPress site will have problems with PHP 7, you can use the PHP Compatibility Checker plugin. This plugin will check all the code on your site to see if anything is incompatible with PHP 7, and give you suggestions for how to fix it. However, this checker isn’t 100% accurate and might not find every issue. The only way you can be perfectly certain that your WordPress site will work with PHP 7 is to move it to a server running PHP 7, then test again.
This is an excellent time to use a WordPress staging site. Instead of upgrading your live site to PHP 7, try making a staging copy of your WordPress website. Then upgrade to PHP 7 on the website’s cloned copy. That way, you can be 100% certain whether everything works. Or you can work on fixing problems, all without harming your live site.
Testing your PHP 7 upgrade with WP Stagecoach staging sites
WP Stagecoach makes it very easy to make a copy of your WordPress site. Your staging copy runs on our servers, which means that it’s easy to use a different version of PHP on the staging site than on the live site.
Just keep in mind that when you create a staging site this way, WP Stagecoach will automatically put that site copy on the same version of PHP as the live site. However, our support team can quickly move your site to a different version of PHP so you can test it. Just shoot us a support ticket, and we’ll take care of it right away!