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
Posted in PHP

3 thoughts on “Install PHP mcrypt on Debian 10/PHP 7.3

  1. So I got a question. Im trying to make a owncloud raspberry pi server
    Im new to this so im not quite sure where you want to put the extension, is it under dynamic extensions or where?

    Also im guessing the semi colon before every extension there shouldnt be repeated for mcrypt?

    • The semi-colon that you may have guessed is to comment out the extensions. So even if you have two and they are both commented, shouldn’t matter. Just need to ensure that one of them is available. I hope that helped.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.