Install PHP mcrypt on Debian 10/PHP 7.3

Here are instructions to install and run mcrypt on Debian 10 with PHP 7.3+

Check PHP Version

$ php -version
PHP 7.3.9-1~deb10u1 (cli) (built: Sep 18 2019 10:33:23) ( NTS )

Check if mcrypt is installed

$ php -m | grep mcrypt

Install pre-requisites

sudo apt-get install php-dev libmcrypt-dev php-pear

Install mcrypt PHP module

$ sudo pecl channel-update
Updating channel ""
Update of Channel "" succeeded

$ sudo pecl install channel://
Build process completed successfully
Installing '/usr/lib/php/20180731/'
install ok: channel://
configuration option "php_ini" is not set to php.ini location
You should add "" to php.ini

Add to the php.ini file

Open the /etc/php/7.3/cli/php.ini file and insert the following at the appropriate place where other extensions are added:

All done. When successful, checking for the presence of the mcrypt PHP module should produce the following output:

$ php -m | grep mcrypt

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store