Magento – Warning: Use of undefined constant MCRYPT_RIJNDAEL_256 – assumed ‘MCRYPT_RIJNDAEL_256’

localhostmagento2.2.6mcryptphp-7xampp

I have setup magento 2.2.6 website on local system. PHP Version 7.2.12 installed on the local system.

When I have run url on local system then getting error:

[2018-12-12 06:51:27] 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) in
D:\xampp\htdocs\testing226\vendor\magento\framework\Encryption\Encryptor.php
on line 394

How to fix the issue? can anyone suggest the solution?

Best Answer

It looks like you are missing the mcrypt php extension.
I've read in various places that it's not that straight forward to install mcrypt on php 7.2.
But you can follow this tutorial on how to do it: https://www.techrepublic.com/article/how-to-install-mcrypt-for-php-7-2/