I followed below steps to install mcrypt for PHP7.2 using PECL.
- Install PECL
apt-get install php-pecl
- Before installing MCRYPT you must install libmcrypt
apt-get install libmcrypt-dev libreadline-dev
- Install MCRYPT 1.0.1 using PECL
pecl install mcrypt-1.0.1
- After the successful installation
You should add “extension=mcrypt.so” to php.ini
Please comment below if you need any assistance. 🙂
IMPORTANT !
According to php.net reference many (all) mcrypt functions have
been DEPRECATED as of PHP 7.1.0. Relying on this function is
highly discouraged.