Home / WordPress / How to use PHP 7 with WordPress

How to use PHP 7 with WordPress

I love WordPress and you also love to use it as a blogger. WordPress really made blogging easy. There are plenty of ways you can go with WordPress, It is easy to install and manage compare to any other content management systems.

PHP is one of the best coding languages for starting a website and WordPress is also written in PHP. PHP comes with lot of customization options and you can create almost any type of website using it.  Since the inception of PHP, It comes with various versions and the latest version of PHP is 7.1.

Today most of the websites are powered by PHP 5.6 and some of are using PHP 7.0. In this article, I am going to show you how to use PHP 7 with WordPress. I will show you some easy steps to move your WordPress site to PHP 7. So, let’s get started:

 An Introduction to PHP 7

Before I am going to describe everything on how to use PHP 7 with WordPress, Some of you might unaware of PHP 7. For those here is a short introduction about PHP 7

PHP 7 is a PHP engine that was launched in December 2016. Unlike its previous version PHP 7 comes with lots of improvements. PHP 7 comes with great security options and it’s also speed up your site.

Also Read:

How to Use PHP 7 with WordPress?

Well when it comes to our WordPress security and performance, PHP 7 did its job very well. Before we proceed to use PHP 7 for our WordPress, there are certain things you have to keep in your mind.  Till now you are using WordPress on PHP 5.2 to 5.6, before moving to PHP 7, make sure that your WordPress is compatible with it. It consists of your themes and plugins.

To check your WordPress compatibility with PHP 7 you have to install the PHP Compatibility Checker: A plugin that scans your WordPress code base and active theme plugins looking for known compatibility issues. Just install it on your blog and select the PHP version to PHP 7.0 to check the result.

php compatibility checker plugin

You will get the detail report of your WordPress themes and plugins that are compatible with PHP 7. If everything is ok than you are ready to use PHP 7 with your WordPress site.

php compatibility result

However there are a certain requirements for this plugin to scan your plugins and themes like:

  1. The plugin cannot detect runtime compatibility issues, since it doesn’t execute any of the existing themes and plugins.
  2. It relies on WP-Cron to scan files in the background, so WP-Cron must be enabled and working on the server.
  3. Occasionally, false positives are reported since the plugin cannot detect unused code paths that may be used for backwards compatibility.

If you have some compatibility issues with your WordPress themes and plugins than it is better to not to move to PHP 7.

select php version menu

Now go to your cpanel. You can usually do it by typing yourdomain.com/cpanel. When you login to your cpanel account, under the software menu select the option “select php version” here you can select the PHP version to 7 and set as current.

Select PHP version

Visit your site to check any further issues. If you find any problem, you can immediately revert back to the ear lier version of PHP (usually to PHP 5.6)

Note: – If you are not using cpanel hosting than you can contact your hosting provider and ask them to enable the PHP for your blog.

Today WPEngine provides you only PHP 7 Web hosting.  So, if you are planning to start your blog or want to move your blog, you can go with them.

If you are using Siteground hosting and using their SG optimizer plugin than with it you can check your blog compatibility with PHP 7 and easily change the version of your PHP.

Summing up the things for you

Let’s quickly recap all that we have learned so far:

  • PHP powers almost 86% of the internet, powering sites such as Facebook and WordPress.
  • The recommended minimum version of PHP is 5.6. Below to PHP 5.6 is not recommended.
  • PHP 7 has significant improvements in terms of performance, security and features — it easily increases your WordPress’ performance by 2x with zero additional hardware.
  • Switching WordPress to PHP 7 brings a lots of benefits without any investment.
  • However, before switching, you need to ensure your WordPress setup is ready to be upgraded to PHP 7 using the PHP Compatibility Checker
  • Shared hosts such as Hostgator, Inmotionhosting, Inmotionhosting etc support PHP 7, but it needs to be enabled manually.
  • Managed WordPress hosts such as WPEngine have rock-solid compatibility with PHP 7.

PHP is continuing to improve with every release. If you’re using WordPress along with only the popular plugins, you could gain a lot by upgrading to PHP 7. It’s drastically improves your WordPress blog’s  performance.

Over to you

After reading all the benefits of using PHP 7 with WordPress, there is no reason that you did not using it with your WordPress? For the sake of your sites performance and security, it is advisable to always update yourself with latest technology. It is highly recommended that you must use PHP 7 with your WordPress blog.

If you have any doubts or question, feel free to ask me by dropping a comment below. Like the post, share it with your friends.

About Vishwajeet Kumar

Vishwajeet Kumar is a passionate and full-time blogger. He is the Owner and Author of this blog. He started his blogging career in late 2016 and has written various articles on Internet Marketing, Affiliate Marketing, Blogging, SEO etc. He loves to help people to get success in their online ventures.

Leave a Reply

Your email address will not be published. Required fields are marked *