cancel
Showing results for 
Search instead for 
Did you mean: 

mcrypt issue with Magento 2.2.8 using PHP 7.1

mcrypt issue with Magento 2.2.8 using PHP 7.1

We recently update our clients site and are now received the following error from our exception log:

main.CRITICAL: Warning: Use of undefined constant MCRYPT_RIJNDAEL_256 - assumed 'MCRYPT_RIJNDAEL_256' (this will throw an Error in a future version of PHP)

 After looking into the issue it was stated that mcrypt is not available in PHP 7.1 however it is required for Magento 2.2.8 which runs on PHP 7.1.

 

Can anyone shed light on how to fix this issue?

3 REPLIES 3

Re: mcrypt issue with Magento 2.2.8 using PHP 7.1

Hi@mark_condello,
If you are using PHP 7.1 before upgrade then  it should work.

BTW You can check mcrypt php extension is enabled or not using following script.
https://community.magento.com/t5/Welcome-to-the-Magento-Community/Hello-Everyone-in-Magento-Communit...

Re: mcrypt issue with Magento 2.2.8 using PHP 7.1

Hello @mark_condello 

 

sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.1-mcrypt


please check above command and try it.

If works then mark as solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: mcrypt issue with Magento 2.2.8 using PHP 7.1

Hi @mark_condello 

 

As we know that mcrypt_module_open() is deprecated from PHP version 7.1 and in Magento 2.2 and its not working with PHP 7.1. I would like to recommend you to study this URL to solve your problem. 

 

I hope it will work for you.

 

Thanks

--
If my answer is useful, please Accept as Solution & give Kudos