How to install PHP Mcrypt extension on Ubuntu 20.04 or Debian

What is the PHP Mcrypt extension?
PHP Mcrypt extension provides encryption facilities to web applications that need the functionality of modern algorithms such as AES. This extension works as an interface to the Mcrypt’s libmcrypt library which implements all the algorithms and modes found in it such as DES, TripleDES, Blowfish (default), SAFER-SK128, LOKI97, GOST, RC2, RC6, MARS, IDEA, RIJNDAEL-128 (AES), RIJNDAEL-192, TWOFISH, TEA, RC2, and more. However, PHP developers have removed it from the PHP package bundle since the launch of php7.2 because of no further development in Mcrypt, thus the extension also gets decrypted. Sodium (available as of PHP 7.2.0) and OpenSSL are now some alternatives to it.
However, the PHP Mcrypt extension has been moved to the PECL repository, thus if somebody wants, he or she can install it on Ubuntu 20.04 LTS using Pear. Here we will show how?
Go to Terminal, if you are using CLI server then you are already there. Simply run the system update command to refresh the repo cache and update the installed packages of the system.
sudo apt update
To install PHP Mcrypt on Ubuntu 20.04 or Debian, we have to install some tools needed to build packages from the source along with some developer dependency packages.

The below two commands will update the channels that allow Pear and Pecl to fetch packages-

Finally, use the Pecl command to download and install php-mcrypt extension on your system

Once the installation is complete to activate the extension we have to add it in the php.ini file of the system. For that simply edit the php.ini file and under Dynamic extension, type: beside other extensions, as shown in the screenshot.
Save the file ctrl+X, type Y, and hit the Enter key.

To ensure your web server has successfully recognized the enabled PHP mcrypt extension, reload the Apache server-


Related articles

Onboard It Tech – Intercom And Access Control Installation

OnBoard IT Tech OnBoard IT Tech is a company that...

How Tall Is Kendrick Lamar

How Tall Is Kendrick Lamar? If you are wondering how...

Chicago Injury Lawyer

Chicago Injury Lawyer Langdon Emison Chicago Injury Lawyer Langdon Emison...

Rumored 2022 iPhone Lineup

There are still a few months to go before...

Lewdle Answer Today March 31

Lewdle Answer Today March 31 Have you been searching for...