Last week we have been busy preparing the Hypernode platform for PHP 7.1. We have recompiled and updated all modules, revised our packaging and build-scripts, and today we will deploy PHP 7.1 to all Hypernodes.

The new PHP version will not be enabled until you purposely do so, but we do install all PHP versions on all Hypernodes alongside each other so switching between versions is near instantaneous. Back when PHP 7.0 first came out it was the norm to uninstall PHP 5.5 before installing PHP 7.0. This caused switching between version to incur between one and two minutes downtime.

When we upgraded to Ubuntu Xenial we updated our packaging so that we could install all PHP versions on Hypernode at the same time. Since then we have been able to switch between versions with minimum intrusiveness. As soon as the Hypernode gets a signal from the control servers to change versions it will disable PHP-FPM for the previous version, change the default command line PHP, and enable PHP-FPM for the new version.

Upgrading to PHP 7.1 from the service panel will be made available soon, but until then you can get in contact with support and ask them nicely.

Why PHP 7.1?

Even though the performance benefit from transitioning from PHP 5.* to 7.0 was way larger than the difference between 7.0 and 7.1, there is still a a few percent to be gained by upgrading to PHP 7.1. Especially because it is virtually a drop-in replacement it is definitely worth the effort. Next to performance there are also some new language features and a couple of new functions which might make it worth your while.

For the downsides take a look at the list of backward incompatible changes and deprecated features. The most notable entry is the deprecation of ext/mcrypt, which is relied on heavily by Magento. Mcrypt is still available in PHP 7.1 but it will completely be replaced by libsodium in PHP 7.2. Luckily the Magento Community Engineering team has efforts under way to remove mcrypt from the Magento PHP 7.2 core, but until then 7.1 will be the most recent supported version.

Other considerations

While not officially supported, it is definitely possible to run Magento 1 on PHP 7.1. To do so install the Inchoo_PHP7 module. But if you do go down that route, read this meditation by Ivan Čurdinjaković from Inchoo. Keep in mind that your mileage may vary, but those arguments could be relevant to your situation.

For Magento 2, remember that PHP 7.1 has only been officially supported since version 2.2. If you look at the technology stack requirements for version 2.1 or lower it will list 7.1.x as incompatible. This seems to be mainly because of the above mentioned mcrypt deprecation. So if you want to run Magento 2 on PHP 7.1, make sure you are at least on version 2.2.

This release will be deployed later today.