After upgrading PHP 7.2, you are prompted for call to undefined function mcrypt_module_open (); mcrypt extension is discarded from PHP 7.1.0, and from PHP 7.2.0, it will be moved to PECL. Fortunately, the installation process is not complicated, run the following command with the root user.
- Pecl
Apt-get Install Php-pecl
2. Related extensions
Apt-get Install Libmcrypt-dev Libreadline-dev
3.mcrypt
PECL Install mcrypt-1.0.1
You will see the following information when you finish executing.
...
Build Process completed successfully
Installing '/usr/lib/php/20170718/mcrypt.so '----> This was our path to MCrypt extension lib
Install ok:channel://pecl.php.net/mcrypt-1.0.1
Configuration option "Php_ini" is not a set to php.ini location
You should add "extension=mcrypt.so" to PHP.ini
4.mcrypt.so Extension added to PHP.ini
In Ln-s soft connection to the CLI and (FPM or apache2)
/etc/php/7.2/mods-available (php.ini)
/etc/php/7.2/cli/conf.d/(CLI)
/etc/php/7.2/fpm/conf.d/(FPM)
/etc/php/7.2/apache2/conf.d/(apache2)
5. Restart PHP-FPM to see that the installation is successful again
Php-i | grep mcrypt
php-m | grep mcrypt
php7.2 Installing MCrypt Extensions