fbpx

Why WordPress Is Getting Picky About PHP Versions

Why WordPress Is Getting Picky About PHP Versions

Have you noticed a prompt on your WordPress dashboard about the version of PHP you are running?  In this post I want to talk about why WordPress is getting picky about php versions.

Here’s a screen shot of the nag I’m talking about.

 

Not seeing this nag, then move along, these are not the droids you are looking for.

What Is PHP?

TLDR: It’s the underlying scripting language that WordPress is built upon

I’ve grabbed this description from the official php scripting language page

PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

Instead of lots of commands to output HTML (as seen in C or Perl), PHP pages contain HTML with embedded code that does “something” (in this case, output “Hi, I’m a PHP script!”). The PHP code is enclosed in special start and end processing instructions <?php and ?> that allow you to jump into and out of “PHP mode.”

What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client. The client would receive the results of running that script, but would not know what the underlying code was. You can even configure your web server to process all your HTML files with PHP, and then there’s really no way that users can tell what you have up your sleeve.

The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer. Don’t be afraid reading the long list of PHP’s features. You can jump in, in a short time, and start writing simple scripts in a few hours.

Although PHP’s development is focused on server-side scripting, you can do much more with it. Read on, and see more in the What can PHP do? section, or go right to the introductory tutorial if you are only interested in web programming.

Why Is WordPress Nagging About Versions

WordPress wants you to be running PHP at the latest most secure version. Older versions have known vulnerabilities that could potentially be exploited by hackers.  So updating closes that loophole.

They want you to have the latest versions of the code so they don’t have to keep WordPress compatible with very old versions of PHP.  That involves a lot of coding and testing against deprecated php function calls.

There are other hidden benefits of updating PHP and that is speed, later versions run much faster than their earlier cousisn.

You May Have Noticed PHP Issues Already

I’ve seen a number of plugins abandon support for php earlier than version 5.4 and you cannot activate that plugin until you update your version of PHP to their recommended level.

The plugin developer has taken the decision not to support deprecated code and demands you update to use their plugin

I suspect WordPress will be abandoning support for earlier version of PHP in the not too distant future so updating php is not only good practise but will be required Soon.

Lets move onto how to update PHP.

Check Before your Update

STOP! before you update PHP be aware this is a big change, take a full backup and do a php compatibility check.  The good new is there is a plugin to do this check for you.

PHP Compatibility Checker

Install and run this plugin.  It will check your site, theme and plugins for forward compatibility.  If it spots any issues with plugins or themes making incompatible, deprecated calls it will let you know and you can decide whether to replace the plugin or abandon your update.to a newer version of PHP.

How To Update Your PHP Version

PHP is controlled by your web server, it’s not set in WordPress, so you will need to login to your hosting account to do this update.  Each hosting company is slightly different so please check with your provider, but here are the most common ways to do this.

If you host uses Cpanel

  1. Log into cPanel
  2. Click PHP Configuration in the Software section

If your host uses Plesk

  1. Log into the Plesk admin panel and select Tools & Settings from the options on the left.
  2. Select Updates and Upgrades from the Plesk column.
  3. Select Add/Remove Components
  4. Use the + next to Web hosting to expand the column, then do the same for PHP interpreter versions. Change your desired version to install and click continue.

If you use Godaddy,

First question why??? 🙂 if you go to the advanced drop down menu there is a programming language option, you can set php version there.

It will take a few minutes to update, once you are at the required level you will know because the nag will disappear.

A Note About Versions

You will see versions 5.x on most hosts as an option to update to, my personal opinion is to jump straight to version 7.x if it is available.  It is the fastest most secure version out there and it will keep you compatible for longer.

Done For You

We first started to notice these nags after the WordPress 5.1 update when we were doing deep checks for our WordPress maintenance clients.  We’ve been testing and updating our clients php version for them.

Our deep checks are when we login to your website and ferret about for error messages or issues that we cannot see from our console.

Here’s a video explaining our deep checks in detail.

If you want a done for you service where we update PHP, signup for a 30 day free trial our our maintenance plan.

Wrap up – Why WordPress Is Getting Picky About PHP Versions

Keeping your PHP up to date is good practise, you get a more secure and speedy experience from your WordPress site.

As I’ve already mentioned I suspect WordPress will  drop support for earlier versions of PHP soon, so you will be forced to update.

Photo Credit: MegzyTred Flickr via Compfight cc

Random image explanation, the monkeys are grooming or nitpicking, it matches my title in a very tenuous way:) Why WordPress Is Getting Picky About PHP Versions

Leave a Reply

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