Friday 19 July 2019

How to Update PHP for WordPress Site

If you’re using WordPress, it’s a good practice to keep an eye out for a new PHP update. Neglecting updates will make your site more susceptible to errors and malicious attacks.

At a glance, updating PHP may sound intimidating – some users may even be afraid that it will break their sites. But in fact, the positives far outweigh the negatives. In this article, we will show you how to update the PHP version for your WordPress site with ease.

Why Should You Update Your PHP for WordPress?


Before you jump into the procedure, you should get to know WordPress first. As a CMS that allows you to create a dynamic site, WordPress makes use of PHP to pull information from the server.

PHP (Hypertext Prepocessor) itself is a server-side programming language that takes care of sending requests to and from the browser and compiling data from the server.

Each time a new version of PHP comes out, a few improvements are added that can make it do its job better, with a few other benefits on top, namely:

  • It makes your site faster. If you want your visitors to load your site faster, this is a benefit you wouldn’t want to miss. The latest version – PHP 7 – is significantly faster than PHP 5.
  • It makes your site more secure. Malicious attacks can cripple your site. Updating PHP to the latest version will result in improved protection against bots and hackers.
  • It helps plugin compatibility. A lot of WordPress plugins rely on PHP to function well, and there’s a chance some won’t work if you still use an older version of PHP.

With that in mind, let’s get ahead of the curb and update your site’s PHP version.

How to Update PHP for WordPress Sites


We’re not going to lie – there’s a slight chance of your site breaking if some components aren’t compatible with the latest PHP version. That’s why we will include various prerequisite steps to ensure it is ready for the update or can be restored immediately if something goes wrong. Better safe than sorry, right?

Step 1: Create A Backup of Your WordPress Site




This is definitely something you must do every time you’re about to make a major change to your site. Regular backups should be a standard practice, but in situations like these, it is especially crucial.

Luckily, you can create a backup easily by using a plugin. One of the best backup plugins out there is UpdraftPlus. It’s easy to install and set up. Plus, you’ll be able to create not only a backup of the core files but of the theme and plugins too.

Installing it is the same as with any other plugin – from your WordPress dashboard, head to Plugins -> Add New then find “Updraft” through search. Once you install and activate the plugin, you can go to the backup interface located under Settings -> UpdraftPlus Backup.




Click Backup Now and wait until the process finishes. Depending on your site’s overall size, this may take a while.

Step 2: Check Your WordPress Site’s Current PHP Version


Make sure that you’re actually in need of updating PHP before you proceed. In order to do this, you need to access your hosting control panel.

If you’re on cPanel, just look for the Software section and choose Select PHP Version. Different providers might use a platform other than cPanel, but the layout should be somewhat similar.




Here you can check your current PHP version as indicated by the red arrow in the screenshot below. If it’s 5.x (e.g. 5.4, 5.6, etc.) then you should update PHP as soon as possible. As of writing this article, the latest version of PHP is 7.3. So, if that’s your current version, you don’t have to update it.



Step 3: Update WordPress, Themes, and Plugins


By updating WordPress, themes, and plugins you get bug fixes and better performance – this will help you smooth out the process and prevent running into issues when updating PHP.

To do this, simply navigate to your WordPress dashboard and check the current version of your WordPress core.




If you see a message informing you about an update being available, click Please update now. Once the update is done, don’t forget to do the same for your plugins and theme through their respective pages.

Step 4: Check Your Site’s Compatibility with the Latest PHP Version


This is yet another precautionary measure to make sure that the updating process will not break your site. Nothing too complicated here as you can make use of a plugin to do the work for you.

From the dashboard, go to Plugins -> Add New and search for “PHP Compatibility Checker.” Install and activate the plugin that is developed by WPEngine. Then, go to the scanning interface located at Tools -> PHP Compatibility.




Select the latest PHP version depending on when you read the article, then choose Scan all plugins and themes to see if they’re compatible. Wait until the plugin finishes scanning.

If the result indicated an incompatibility issue with one of your plugins, don’t get rid of it just yet. There’s a chance that it’s a false positive and it will actually work fine. You should refer to the whitelist of plugins that may cause a false positive.

It’s worth noting, that while this is the best compatibility scanned available, it doesn’t yet support PHP version 7.3. We recommend using it for that update specifically.

Alternatively, if you don’t have a massive ammount of plugins installed, you can always check their respective official pages for compatibility information.

Step 5: Update Your PHP Version


Now that everything is ready, you shouldn’t run into issues when updating PHP to the latest version.

To begin the update head to your control panel, proceed the same way you did when you were checking for the current PHP version. Under the Software section look for Select PHP version.




Here, click the little blue arrow to show a drop-down menu and choose the latest PHP version available. Then, click Set as current and you’re all set! Once the process is complete your WordPress site will run the latest PHP version.

What’s Next?


Once the update is complete, it may take a while for you to start noticing any changes in your site, depending on traffic. To make sure everything still works properly, we suggest checking your site every now and then for errors or bugs.

If your site breaks, try deactivating all the plugins and activating them one by one to figure out which may be causing the issue.

All in all, we recommend you always keep your PHP version up-to-date. There’s an improvement with every new release that can make your WordPress site perform better and protect it from errors and bugs.



0 comments:

Post a Comment