php7.2 安装mcrypt扩展 Call to undefined function mcrypt_get_block_size

Since the mcrypt extension abandoned in php7.2, so it is necessary to continue to use this extension if needed to compile the mcrypt extension.

Native environment:

ubuntu18.04 
php7.2

If the version of ubuntu 16.04 or 14.04 version, try using the priority add pp: ondreg installed php, php and expansion

the Add-APT-Repository the sudo PPA: Ondrej / PHP 
the sudo APT-GET Update 
the sudo-php7.2 the install the mcrypt APT (there may be mounted directly, not tested)

If the above method does not work, with reference to the following process steps

Download the appropriate version from the mcrypt library address, and then extract

wget http://pecl.php.net/get/mcrypt-1.0.1.tgz 
tar zxvf mcrypt-1.1.1.tgz

You may need to install phpize

sudo apt install php7.2-dev

Switch to extract the directory, compiler installation, according to the actual situation can be

cd mcrypt-1.0.1 
phpize 
./configure 
make && sudo make install

If the 
error::. Configure. Mcrypt.h not  found Please reinstall libmcrypt
error can install mcrypt library

apt install libmcrypt-dev

Address appears similar to the following prompt if successful, the path behind file generated to represent mcrypt.so

Installing shared extensions: /usr/lib/php/20170718/

Finally extended configuration configure php, add the extension = mcrypt.so on it

Original Address: https://blog.csdn.net/yhb598712254/article/details/80621473

Published 44 original articles · won praise 28 · views 420 000 +

Guess you like

Origin blog.csdn.net/hanzengyi/article/details/83385803