The question you may want to ask is why the mcrypt module is no longer supported with PHP-7.2. Again, there may be a legitimate reason not to support it. If you are running a PHP application that relies on the mcrypt module and you want to upgrade to PHP 7.2, then continue with the post below to learn how to install PHP 7.2 mcrypt module on Ubuntu 18.04 LTS servers and desktops. To get started with installing the module follow the steps below:

Install PHP-7.2

Before installing the mcrypt module, you must first install PHP-7.2 on Ubuntu. to do that, run the commands below: After installing PHP above, continue below to install the required dependencies that will allow you to install the mcrypt module.

Install Required PHP Dependencies to Install Mcrypt

Now that PHP-7.2 is installed, run the commands below to install the required dependencies that will allow the mcrypt module to be installed on Ubuntu with PHP-7.2 support. To install the required packages, run the commands below After that, continue below to install mcrypt. Now that PHP-7.2 and all its required dependencies to install mcrypt are installed, run the commands below to install PHP mcrypt module on Ubuntu using pecl channel. After running the commands above, you should see a message that reads PHP mcrypt module was successfully installed. and that you should include the mcrypt. so extension in the php.ini file. Finally, run the commands below to open the PHP configuration file. Then add the line below into the file, just below [PHP], and save. Save the file and you’re done. If you’re going to be using an Apache2 HTTP server with PHP support, you may also want to add the mcrypt.so extension to the php.ini file below: For Nginx, use this: Now the mcrypt module should be installed and ready to use. Enjoy! You may also like the post below: