Upgrade WordPress to PHP 7: How to Do It Safely | Code it | Scoop.it

To upgrade WordPress to PHP 7, the process itself is easy.

 

In this article, we'll teach you how to make the switch and upgrade WordPress to PHP 7 the right way.

 

If you have full privileges on your server, you can upgrade WordPress to PHP 7 using your command line. On the other hand, if you’re on shared or managed hosting, you’ll probably have to ask your provider’s support team to upgrade your site manually.

 

In either case, the actual process is straightforward. The problem is that if you don’t take any precautionary measures, you run the risk of breaking elements of your site that don’t play nicely with PHP 7. That’s why we’re partial to a different approach that enables you to eliminate most of the risk involved.

 

Step #1: Back up your website

Step #2: Create a local staging copy of your site

There are plenty of ways to create a staging copy of your website, Try Local by Flywheel because it’s easy to set up. Plus, you don’t need to be a Flywheel customer to get the app. Just go to the website, fill out a short form, and download the tool.

Step #3: Test your staging site

Step #4: Upgrade your live site to PHP 7

There are two ways to approach it, depending on your host:

 

  1. If you use a Virtual Private Server (VPS) or any other hosting option that gives you full control, you can upgrade WordPress to PHP 7 from the command line.
  2. If your host doesn’t give you this level of access, you can ask them to upgrade you to the latest version through their support system.

 

When you’re done, be sure to test your site’s performance again (just to be safe). 

 

references:  

 

https://themeisle.com/blog/upgrade-wordpress-to-php-7/

 

https://wpengine.com/resources/upgrading-to-php-7/