So I wanted to try out Magento 2 on php 7.1 (I use ubuntu 16 xenial). Everything seems to be working — I ran into one issue with the mcrypt functionality being deprecated in php 7.1 On every page load I was receiving:

Function mcyrpt_module_open() is deprecated

Looking on github, it seems Magento is aware of this and mcrypt support will be removed in 2.2 (or maybe even 2.1.2).

However, if you’re like me (and you don’t want to wait) there is just one file that you need to patch. (I tried disabling the DEPRECATED warnings, however in developer mode it seems that Magento re-enables these).

The file in question is vendor/magento/framework/Encryption/Crypt.php. You need to go through the file and add the @ sign before any of the mcrypt calls (this instructs the php interpreter to suppress warnings generated from these lines).

For example:

$this->_handle = mcrypt_module_open($cipher, '', $mode, '');


$this->_handle = @mcrypt_module_open($cipher, '', $mode, '');


Pretty simple! If you don’t want to patch it by hand, download the modified version of the file here.