调用未定义函数 mcrypt_module_open

Call to undefined function mcrypt_module_open

我正在使用 magento,当我加载页面时出现以下错误:

( ! ) Fatal error: Uncaught Error: Call to undefined function mcrypt_module_open() in /Users/my-pathlib/Varien/Crypt/Mcrypt.php on line 63

我正在使用 php7.1 并安装了 mcrypt:

sudo apt-get update
sudo apt-get install mcrypt php7.1-mcrypt
sudo apt-get upgrade
sudo service apache2 restart

然而,当我重新加载页面时,我得到同样的错误?

我在这里做错了什么?

-- 编辑

当我 运行 php -i 我看到:

mcrypt

mcrypt support => enabled
mcrypt_filter support => enabled
Version => 2.5.8
Api No => 20021217
Supported ciphers => cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream

Directive => Local Value => Master Value
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value

这可能是因为您的 magento 版本与您的 php 版本不兼容。