Tried everything to increase the speed of the website? But if you are still reading this article then surely caching plugins like W3 Total Cache didn’t help you much and you are still not happy about your site performance. If you haven’t tried the other options, you can try them out first.
Before starting this technique, there are some basic things which you should be aware of. Only some of us are aware of the fact that WordPress, the biggest CMS is based on PHP. Though there are a lot of advancements in PHP even though on latest version PHP 7.1. Most of the WordPress based sites still use version php5X just for the reason that it is more compatible with WordPress. But with advancements in PHP version 7.1, it can make a website load 3X faster. The reason for this is that the Execution and Processing power of PHP 7.1 is faster as compared to PHP 5X. So, how to get your website on PHP 7.1.
Let’s get started:
1. Backup site:
Just for a safer side take backup of your website including its database just in case if your site is not supportive to PHP 7.1.
2. Updating WP Core, plugins & theme:
SO first we start with updating all the components of WordPress like – Theme, Plugins and WordPress Core files. Outdated plugins and theme might not support the latest PHP version as they might be only tested on PHP 5X and aren’t compatible with the new one. So for moving on with this technique, it is important that your theme supports the latest PHP version. Once you have updated the wWordPress core files, themes, and plugins. Check your site once for its looks and functionality just to be sure that everything is working just fine as before.
3. Changing PHP Version:
Here we come to the final step of changing the version of PHP to latest 7.1. Once the updated website works fine, the version has to be changed. Changing the version of PHP is an easy step and differs based on the hosting your site is on.
a. Shared Hosting
Most of the sites are on Shared Hosting, and they are flexible with PHP 7.1. For Shared Hosting you can change it from your cPanel.
cPanel URL: your_website_url/cpanel
Once you login to your cPanel account goto>> PHP Selector/ Multi PHP Manager >> select the PHP Version and Don’t forget to save your settings.
b. Managed WordPress Hosting
In Managed WordPress Hosting you don’t have access or control over the settings of your site. So, if you have a Managed Hosting you just have to ask the provider to change the version for you.
c. VPS/ Dedicated Server
If you host a Dedicated Server for your website, changing the PHP version becomes a quite tricky. It mostly depends on different factors like the Control Panel that you are using. If you are using cPanel on your dedicated server, the process goes same like the Shared Hosting.
But if you don’t have cPanel installed, then things you need to follow are a bit more of a technical. In that case, you first need to install PHP 7.1 on your server using the command line and then set it as the default version.
Verify if PHP 7.1 is enabled?
Once PHP version is enabled, you need to check if it is working for your site. Verification is very easy. Create a PHP file named verify.php in root directory and in that file paste this code
<?php phpinfo(); ?>
And save this file. Now all you need to do is open this newly created file in the browser.
You will see the all technical information related to the PHP version. The top of the file denotes the version of the PHP version on which your site is working.
Now that you have verified the version of PHP. It is highly recommended that you check your site for its functionality.
After checking the functionality if you are getting error 500? Don’t be afraid? It is the most common error that occurs when you upgrade to PHP 7.1 from the older one. This error occurs if your theme or plugin is not supporting the new PHP version.
Now if your website is working fine. If your website shows no change or distortion. There is a reason for you to be happy. But before that, we need to be completely sure if it is working fine. For most of the times, there are some of the hidden errors which aren’t displayed anywhere or do not affect the functionality of the website.
For testing to be certain about the changes made we need to enable the debug mode in WordPress. This is quite simple. All you need to do is install a plugin named ‘Debug bar’. Once the plugin is installed and activated, you will notice a button in the top right corner of your WordPress Dashboard. All you need to do is turn it on to check for hidden errors. If you see no errors, then you are good to go, but if there are errors you need to fix them.