在PHP 7.3.13 Ubuntu上安装mcrypt时出现问题

这就是我一直在做的。

$ sudo apt-get -y install gcc make autoconf libc-dev pkg-config
$ sudo apt-get -y install libmcrypt-de
$ sudo pecl install mcrypt-1.0.2
> libmcrypt prefix? [autodetect] :

我在php.ini中添加了“ extension = mcrypt.so”

那我做

sudo bash -c "echo extension=/usr/lib/php/20190902/mcrypt.so > /etc/php/7.2/cli/conf.d/mcrypt.ini"
sudo bash -c "echo extension=/usr/lib/php/20190902/mcrypt.so > /etc/php/7.2/apache2/conf.d/mcrypt.ini"

I followed these instruction: https://lukasmestan.com/install-mcrypt-extension-in-php7-2/

Lastly I check with php -i | grep mcrypt

这是我的输出:

PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20190902
PHP    compiled with module API=20180731
These options need to match
 in Unknown on line 0
/etc/php/7.3/cli/conf.d/20-mcrypt.ini,
/etc/php/7.3/cli/conf.d/mcrypt.ini

我已经检查了20-mcrypt.ini和mcrypt.ini,它们看起来完全一样。 但是我的PHP似乎是使用错误的模块API编译的。我在Google周围搜索,但找不到任何具体的信息。有任何想法吗?谢谢!

enter image description here

我一直在用

评论