Programster's Blog

Tutorials focusing on Linux, programming, and open-source

Ubuntu 18.04 - Install Mcrypt for PHP

PHP
sudo apt install php-7.2
sudo apt install php-dev libmcrypt-dev php-pear
sudo pecl channel-update pecl.php.net
sudo pecl install mcrypt-1

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:

extension=mcrypt.so

For example:

...
;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;
extension=mcrypt.so
...

References