Skip to content

Instantly share code, notes, and snippets.

@smcjones smcjones/compat.md
Last active Mar 3, 2017

Embed
What would you like to do?

#PHP Compatibility

###Content

###What is PHP?

PHP is a programming language, and one of the most common used on the web. WordPress is written in PHP, and so plugins, like WordPoints, are written in PHP as well. In order to be able to run a program that is written in PHP, the web server that your site is on needs to have the software installed to interpret the PHP language.

###Why are there different versions?

Over time, as the web evolves, new versions of PHP are released. This is done for multiple reasons:

  • To improve the security of the language
  • To fix bugs
  • To improve speed and performance
  • To add new features to help developers more easily create great software.

New versions of PHP are released regularly, and in order to better protect your site from getting hacked, and in order to run code that uses newer features, the version of PHP that is running on your server needs to be updated.

###Do I need to update?

Starting with version X.X, WordPress displays a notice in the (Dashboard?) if it detects that your installation doesn't have a recommended version of PHP. If you reached this page via this kind of notice, then your server’s PHP version should probably be upgraded. Just how urgently depends on the message:

Green: You're running a safe and current version of PHP that WordPress recommends. Yellow: Your PHP version is still being supported with security updates, but your website can be faster. Some plugins may not work. Red: You are running an version of PHP that is no longer receiving security updates. This means your website is at greater risk of getting hacked, and many plugins will not work.

Why is my PHP out of date?

Why is your server running an old version of PHP? That is actually a really good question. It is a good idea to always run the latest stable version of PHP, if possible. As of February 2017, the latest stable version of PHP is 7.1. WordPress currently recommends at least PHP 7.0. Older versions of PHP, like PHP 5.2, are no longer maintained by the official developers of the PHP language. This means that any bugs in the language are no longer fixed by them, including security vulnerabilities. So running an old version of PHP can potentially become a security issue, unless your web host is making sure that they are fix any issues that are discovered.

Because of this, web hosts will often update the PHP version of their users’ accounts periodically. Sometimes they wait a while to do this, so that they can update all of the sites on a server at once. Probably your host hasn’t updated the PHP version for your site yet because there are some other people hosting with them that are using outdated software, that might not be compatible with the latest PHP versions, and your host is working to update that software before they upgrade everyone’s accounts at once. However, you probably don’t have to wait.

How do I update PHP?

First, download the PHP Compatibility Checker plugin by WP Engine to see if your website will upgrade without issues.

If all checks out, you're ready to go.

Most popular webhosts have an interface for changing the PHP version your site is running on. Check your host’s documentation or support for more details. A few examples:

SiteGround GoDaddy Bluehost DreamHost HostGator

When in doubt, contact your host’s support.

What will happen if I don’t update PHP?

It's possible that nothing bad will happen. However:

  • You may find that many new plugins do not work, and plugins which used to work will not update for you. Many WordPress plugins have minimum versions that are higher than WordPress' minimum version of 5.2.9. If you try to download and install these plugins
  • Your website will be more vulnerable to well-known exploits. Because WordPress is software written in PHP, and not a language itself, WordPress cannot protect against all PHP vulnerabilities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.