As an alternative, you can install 7.1 version of mcrypt
and create a symbolic link to it:
Install php7.1-mcrypt:
sudo apt install php7.1-mcrypt
Create a symbolic link:
sudo ln -s /etc/php/7.1/mods-available/mcrypt.ini /etc/php/7.2/mods-available
After enabling mcrypt
by sudo phpenmod mcrypt
, it gets available.