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.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:

extension=mcrypt.so

For example:

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

References

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

This blog is created by Stuart Page

I'm a freelance web developer and technology consultant based in Surrey, UK, with over 10 years experience in web development, DevOps, Linux Administration, and IT solutions.

Need support with your infrastructure or web services?

Get in touch