PHP mcrypt extension
Update
apt update
Install Development tools
apt install -y build-essential
Konfirmasi make dan gcc
gcc --version make --version
Install PHP, dev dan pear extensions
apt install php php-pear php-dev libmcrypt-dev
Konfirmasi pecl
which pecl /usr/bin/pecl
Cara menggunakan pecl
pecl help
Update Channel
pecl channel-update pecl.php.net Updating channel "pecl.php.net" Update of Channel "pecl.php.net" succeeded
pecl update-channels Updating channel "doc.php.net" Update of Channel "doc.php.net" succeeded Updating channel "pear.php.net" Update of Channel "pear.php.net" succeeded Updating channel "pecl.php.net" Channel "pecl.php.net" is up to date
Cari mcrypt extension
pecl search mcrypt
Retrieving data...0% .Matched packages, channel pecl.php.net: ======================================= Package Stable/(Latest) Local mcrypt 1.0.6 (stable) Bindings for the libmcrypt library mcrypt_filter 0.1.0 (beta) Applies mcrypt symmetric encryption using stream filters
Install mcrypt
pecl install mcrypt downloading mcrypt-1.0.6.tgz ... Starting to download mcrypt-1.0.6.tgz (27,062 bytes) .........done: 27,062 bytes 6 source files, building running: phpize Configuring for: PHP Api Version: 20170718 Zend Module Api No: 20170718 Zend Extension Api No: 320170718 libmcrypt prefix? [autodetect] : <enter>
Aktifkan extension di dalam php.ini
nano /etc/php/*/cli/php.ini tambahkamn extension=mcrypt.so pada baris extension ; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+) ; extension folders as well as the separate PECL DLL download (PHP 5+). ; Be sure to appropriately set the extension_dir directive. ; extension=mcrypt.so ;extension=bz2 ;extension=curl ;extension=fileinfo ;extension=gd2 ;extension=gettext
nano /etc/php/*/apache2/php.ini tambahkan extension=mcrypt.so pada baris extension ; - Many DLL files are located in the extensions/ (PHP 4) or ext/ (PHP 5+) ; extension folders as well as the separate PECL DLL download (PHP 5+). ; Be sure to appropriately set the extension_dir directive. ; extension=mcrypt.so ;extension=bz2 ;extension=curl ;extension=fileinfo ;extension=gd2 ;extension=gettext ;extension=gmp
Konfirmasi
php -m | grep mcrypt mcrypt