April 30, 2018 by Paul G. | Ask Paulie Anything

What is the best PHP version for WordPress – Ask Paulie Anything, Episode 3

Shield Logo

First of all, I’d like to thank for all your questions and feedback we’ve got so far regarding our Ask Paulie Anything project. 🙂

Today We’re Discussing Which Versions Of  PHP Are Best For WordPress

I get a quite number of questions about PHP versions and different settings that you can set to manage PHP.

Today, we’re going to discuss what version of PHP is best to run for WordPress, but you’ll also learn a strategy on how to upgrade your website PHP from 5.2 to PHP 7.0 in a way that’s not likely to break your site.

So, the question is:

Which PHP version is best for WordPress and what minimal extensions one must select in PHP Selector for optimal working and speed of the WordPress website?

This is a two-part question:

  1. PHP Selector; and
  2. PHP version and what’s best for WordPress.

0:38 – PHP Selector

I’m assuming the PHP Selector in this question is something like cPanel’s EasyApache configuration. I think these things come with “default” selections for PHP extensions.

Unless you know what you’re doing, and unless you have a good reason to do otherwise, leave the defaults exactly as they are. If there’s a plugin that needs a particular extension for PHP and you haven’t compiled that, with cPanel EasyApache that’s very easy to do after the fact.

So, my advice is:

Leave everything at defaults unless you have a very good reason not to, and unless you understand what you’re doing.

1:21 – What Version Of PHP Is Best To Run For WordPress?

People might tell you that you must be on the latest version of PHP (7.2 at the time of writing) and that you must update as soon as updates come out… all that great stuff which isn’t very practical for most people. But, generally, the higher version of PHP you’re on, the better.

If you’re running PHP 5.2 for example, which is over 10 years old at this stage, then you really need to take steps as soon as possible to move from that.

Important: If you’re on the web host that does not make it easy for you to upgrade to at least PHP 7.0, move to another web host. You should always be on a web host that is at least good enough to allow you the option to upgrade your PHP.

So, when you’re choosing your PHP version what you want to do is strike a balance between compatibility on your site and running the latest version of PHP that you can.

2:23 – How To Safely Upgrade Your WordPress’ PHP

We’re going to offer a safe approach and guidance on how to upgrade your WordPress PHP to PHP 7.0 and above in a way that’s not likely to break your site.

Let’s take for example that you’re on PHP 5.2.

It’s not a good idea to jump into your web hosting control panel and switch to PHP 7.0. If you want to break your site, that’s probably the best way to do it.

What I would advise to get as high a version as you can is to stair-step it.

Rather than go straight from 5.2 to 7.0, go from 5.2 to 5.3. If you’re happy with that, move on to the next version of PHP – 5.4.

The point is to bring you slowly up to the point where you can run the latest version of PHP without breaking your website.

So, if you’re on PHP 5.2, follow these steps:

  1. Turn on the PHP 5.3
  2. Leave it for a few weeks (even for a month) and test everything
  3. Once you’re happy with it, move on to the next level (5.4) and repeat the Step 2
  4. If you get errors or notices, take a very clear note of those errors or notices and give them to the plugin developers, depending on where those errors happen. Hopefully, they can sort it out.

3:47 – You don’t need to run WordPress on the absolute latest version of PHP

WordPress.org Statistics: PHP Versions

Recently, WordPress.org said that the recommended version for WordPress is PHP 7.2… But, I would advise against going all the way up to PHP 7.2.

If you’re running PHP 7.1 and have been doing so for a long time, then perhaps yes, test PHP 7.2.

But, if you’re happy enough, you could stay at 7.1 for a while. 7.2 is new, and those running 7.2 and above is still tiny.

Just get as high as you can (ideally 7.1) and leave it, be comfortable with that. But, don’t feel you have to go to the greatest and latest.

Thank You! Comments, Questions?

Hope that helps with PHP versions.

If you want to send your own question, please feel free to do so by using the link below. You can ask anything you want and I’ll do my best to get your question answered. 🙂

Ask Your Own Question Here.

If you’re watching this video on YouTube, you can subscribe or you can use Facebook and “Like” our One Dollar Plugin page. You’ll find all our videos there. 🙂

Hello dear reader!

If you want to level-up your WordPress security with ShieldPRO, click to get started today. (risk-free, with our no-quibble 14-day satisfaction promise!)

You'll get all PRO features, including AI Malware Scanning, WP Config File Protection, Plugin and Theme File Guard, import/export, exclusive customer support, and much, much more.

We'd be honoured to have you as a member, and look forward to serving you during your journey towards powerful, WordPress security.

Try ShieldPRO Today →

ShieldPRO Testimonials
@hotfrog's Gravatar @hotfrog

Much flexible stronga.

So muchly expandbo, someble intimidous, but moriable matie.

@thorn_fallen's Gravatar @thorn_fallen

Simple and Easy Security

I have found Shield to be easy to use and understand. With great functions even with the free version!!

@captzeanie2016's Gravatar @captzeanie2016

Works great

A very good plugin

@emyllobryan's Gravatar @emyllobryan

Seamless

Simple Security Firewall allows you to protect your site seamlessly. You don’t notice it until there’s suspicious activity. That’s when you’ll be glad you have it! I am not tech savvy…at all, and Simple Security Firewall makes it easy, even for me.

Comments (4)

    Thanks Paulie, replying my question. It is appropriate reply.
    Right now, some of my sites are on php 7.2, and I don’t see any issue…

      Happy to answer your question, Anil 🙂
      Glad to hear you’re happy with the answer, and that you’ve had success with PHP 7.2!

    The thing that stops me from upgrading beyond 5.3 is the dreaded “call time pass by reference” error – I have several older plug-ins and a them that will probably trigger it, and an entire old site on a legacy CMS that barely works with 5.3.

      Hey Lee,

      Yea, this is a tricky warning and many people are held to ransom by old code and developers that wont update their code. It’s far from ideal.

      If the older plugins aren’t ever going to be updated by the developers, you could go in an change the code manually yourself. Wherever you get the error, just to the line of code and remove the single ampersand (&) from in-front of the variable. And then you’re free 🙂

      Hope that helps!

Leave a Reply to Paul G. Cancel reply

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

Click to access the login or register cheese