Skip to content

Instantly share code, notes, and snippets.

@kevinski303
Last active March 3, 2021 23:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevinski303/88dedbb4734d4518e03556494be84ec7 to your computer and use it in GitHub Desktop.
Save kevinski303/88dedbb4734d4518e03556494be84ec7 to your computer and use it in GitHub Desktop.
php-mcrypt on debian 10 & php 7.3 apache
#
# The php-mcrypt extension is depricated and therefore was removed from the apt repository.
# As of writing this, on php7.3 there is currently no other way to install mcrypt without downgrading the php version
# except for compiling it locally.
#
###
#
# 1; Install the php-dev version and all the used tools to compile the extension
#
$ apt install php7.3-dev gcc make autoconf libc-dev pkg-config
#
# 2; Download the archive from pecl
#
$ pecl download channel://pecl.php.net/mcrypt-1.0.2
#
# 3; Extract the archive
#
$ tar -zxvf mcrypt-*.tgz && cd mcrypt-*/
#
# 4; Run phpize configuration and compile
#
$ phpize
$ ./configure
$ make install
#
# 5; Check if the module is available
#
$ ls /usr/lib/php/20180731/ | grep mcrypt.so
#
# 6; Enable in php.ini & restart apache
#
$ echo 'extension=mcrypt.so' >> /etc/php/7.3/apache2/php.ini
$ systemctl restart apache2
@torstenzenk
Copy link

torstenzenk commented Jun 29, 2020

if you get the "configure: error: mcrypt.h not found. Please reinstall libmcrypt" error while "./configure", simply use sudo apt install libmcrypt-dev
Then you can go on within number 4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment