PHP has officially marked PHP 7.1 as having reached ‘End of Life’ status. A good time for us to go over the various available versions of PHP, and the (dis)advantages of these versions. We all know that updating software is a ‘necessary evil’, required from time to time to keep your webshops and sites secure. But did you know that upgrading to a newer PHP version might actually have a positive impact on the speed of your sites?
No more updates for PHP 7.1
Even though it may feel like PHP 7.1 was only just released, it’s already been 3 years since it came out. Taking into account PHP’s published support charts, that means it’s Active Support phased ended over a year ago, and for the last year it’s only been receiving critical security updates, but no more general bugfixes. And now that it’s reached end-of-life, even those updates have ended. Any sites still running on PHP 7.1 are thus at-risk; if, at some point in the future, a security issue is found in PHP 7.1, no official update will be released.
Now while there might still be volunteers in the open source community out there releasing patches for critical security issues, these often come with their own issues. It may take some time for them to be released, the security/stability of these might be sub-par compared to official patches, or they might even be mostly untested and “It worked for me” territory. Plus, with each patch released, it may become harder and harder to integrate all the various community patches into one cohesive, stable, system. Not something you want to have to rely on if e-commerce is your business.
Our goal has always been to offer older PHP versions for as long as possible, on Hypernode. We even still offer PHP 5.6 and 7.0, even though both went end-of-life around late 2018 and are not receiving security updates anymore either. Still, it might be worth it to upgrade to a supported PHP version, such as 7.2, or 7.3, which are still supported until late 2020, and 2021 respectively.
Time to upgrade?
Updating software, unfortunately, is something that’s here to stay. With PHP pushing a new version once a year, it pays off to plan ahead and keep up to date. Especially if you’re an agency that manages multiple sites, for multiple customers. Just for PHP you’ll need to upgrade to a newer version every 1.5 – 2 years, just to ensure you’re always running on a supported version. Luckily, upgrading your PHP is something that comes with a lot of benefits.
Of course a modern PHP version is more secure than an old one, but did you know that upgrading can actually have a positive impact on your sites’ and PIM’s performance? In tests, each PHP version is 10-20% faster than the last. So if you’re running a reasonably modern shop or PIM, upgrading from PHP 7.1 to 7.2, or even straight to 7.3, should almost always have a positive impact on loading times. And upgrading PHP is a lot less scary nowadays. Thanks to automated tests, modules are also forced to keep up. Because of this, upgrades go a lot faster than they historically did. Most sites will work out of the box with newer PHP versions.
What steps should I take?
Upgrading PHP has gotten a lot easier over the years. While it’s still not something to blindly jump in to, by taking a few steps before you get started, it should be possible to upgrade without too much of a hassle.
Unfortunately it’s not possible to run both PHP 7.1 and 7.2 on a single Hypernode. To test how your shop runs on PHP 7.2, you’ll have to use a separate development environment. You can do this by using a Hypernode Docker or by temporarily setting up a Development node. You can then make a copy of your production environment to a completely separate node. This allows you to fully test all aspects of your site, without impacting the production environment and disrupting visitors.
While core modules have been well tested for compatibility, the same cannot be said for every single external module; especially those not installed via the marketplace. As such we’d highly recommend you contact your module vendors and see if the modules and versions you’re using are compatible with newer PHP versions. If not, upgrade and test these on your existing PHP version first, if possible.
If you’re using Magento 2.2.10 or higher, than your Magento supports PHP 7.2, and you should be able to upgrade. If you’re using an older Magento 2, you’ll have to upgrade your Magento version first to a supported version. Magento 1.9 users will have to install a patch before continuing.
Upgrading your PHP version luckily doesn’t take that long. The easiest way to do it is by using the Control Panel.
- Log in on the Control Panel
- Select the Hypernode of which you want to change the PHP version
- Go to ‘PHP Settings’
- Choose the PHP version and click on ‘Change’
If you have the technical knowledge, you can also doing it by running the following command on your SSH shell: hypernode-systemctl settings php_version –value=7.2.
Less than 5 minutes later, your Hypernode should be running on a new PHP version, and you can start testing.