We're live on Product Hunt!

Upgrade your PHP

What version am I running?

Please wait...

Outdated & Current:

PHP 5.6 will NOT receive security updates after 31 Dec 2018 (in days).

PHP 7.0 will NOT receive security updates after 3 Dec 2018 (in days).

PHP 7.1 will receive security updates until 1 Dec 2019.

PHP 7.2 will receive security updates until 30 Nov 2020.

PHP 7.3 is coming out in late 2018 and will be supported for 3 years.

Your web server or host may disable the version header. There are other ways you can find out:

  • Check the admin panel on your hosting provider. Some hosts use software like cPanel to allow you to configure the version.
  • Create a PHP file containing phpinfo(), which returns information about your live version.
  • If you have SSH access to your server, run a command such as php -v. Note: this uses the default version of PHP, which may be different to the one your site uses.
State of affairs

According to w3techs, 78.9% of websites use PHP. The version distribution is as follows:

How do I upgrade?

If your software supports 7.x, it can be as simple as upgrading the package on your server. Check out a guide for your specific operating system on how to do this. For example, here is how to do it for Ubuntu.

If your software contains 5.x-only features, you will need to update your software. Hiring a developer (or me) will allow you to get the benefits from the latest PHP version. The official website contains a guide on some of the things to look out for when migrating. Virtually all frameworks support PHP 7.x so upgrading is a matter of updating the glue code.

The issues...
  • Unsupported plugins/frameworks - Some software or plugins that you may use might not support 7.x.
  • Backwards incompatibility - A number of PHP extensions were removed in 7.x. The official PHP migration page lists all the things to look at.
  • Technical debt - Upgrading from 5.x to 7.x to receive performance benefits doesn't fix the long-term technical debt.
  • Unable to upgrade - Some hosting providers don't offer the ability to switch to 7.x.
  • "It works fine" - That may be true, but it doesn't stop the security vulnerabilities.

Why upgrade?

Performance

PHP 7.x ships using the PHPNG engine, giving drastic improvements in speed and CPU usage. This makes the whole site more responsive and search engines, like Google, use page speed in their ranking algorithm.

I can also speed up your website! Contact me at @DanielLockyer or [email protected]

This benchmark from Kinsta.com shows the improvements to requests/second for WordPress:

Phoronix ran PHPBench on different versions and found this:

One of my clients upgraded their PHP application in 2016 and saw this kind of CPU usage drop:

This has the potential to reduce server requirements, and therefore costs.

Security fixes

PHP doesn't have the best track record when it comes to security vulnerabilities. When a version reaches end of life status, it stops getting future security updates. This can present a risk to both yourself, and your users. All it takes is someone holding on to a 0-day exploit for everyone to have a very bad time.

New language features

Each minor version bump in PHP comes with new language features that allow for more terse, expressive code.

I can help you upgrade PHP! Contact me at @DanielLockyer or [email protected]

by Daniel Lockyer