Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Ubuntu 18.04 - Install Mcrypt for PHP

sudo apt install php-7.2
sudo apt install php-dev libmcrypt-dev php-pear
sudo pecl channel-update
sudo pecl install mcrypt-1.0.3

After doing that you need to add the extension to your php.ini file.

sudo vim /etc/php/7.2/cli/php.ini

Find the section called Dynamic Extensions, and add the line:

For example:

; Dynamic Extensions ;


Last updated: 26th February 2022
First published: 3rd October 2018