Because of the module mcrypt for PHP neot being maintained since a bout 10 years the PHP team has decided to drop it from the PHP version 7.2 on.
For PHP applications that need this module here are the instructions to compile and install it for PHP 7.2.

We need to install the proper building tools for PECL Mcrypt 1.0.1

Install mcrypt extension
sudo apt-get -y install gcc make autoconf libc-dev pkg-config
sudo apt-get -y install libmcrypt-dev
sudo pecl install mcrypt-1.0.1

When you are shown the prompt
libmcrypt prefix? [autodetect] :
Press [Enter] to autodetect.

After success installing mcrypt trought pecl, you should add extension to php.ini.
The output will look like this:

Build process completed successfully
Installing '/usr/lib/php/20170718/' ----> this is our path to mcrypt extension lib
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

Grab installing path and add to cli and apache2 php.ini configuration.
sudo bash -c "echo extension=/usr/lib/php/20170718/ > /etc/php/7.2/cli/conf.d/mcrypt.ini"
sudo bash -c "echo extension=/usr/lib/php/20170718/ > /etc/php/7.2/apache2/conf.d/mcrypt.ini"

Verify that the extension was installed
Run command:
php -i | grep "mcrypt"
The output will look like this:

Registered Stream Filters => zlib.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, convert.iconv.*, mcrypt.*, mdecrypt.*
mcrypt support => enabled
mcrypt_filter support => enabled
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value