php 使用未定义的常量 MCRYPT_BLOWFISH

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24608625/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 17:23:35  来源:igfitidea点击:

Use of undefined constant MCRYPT_BLOWFISH

phpapachemcrypt

提问by Ben Rogmans

After reinstalling our server, MCRYPTis no longer working and PHP gives the notice

重新安装我们的服务器后,MCRYPT不再工作并且PHP给出了通知

Use of undefined constant MCRYPT_BLOWFISH(Apache 2.4, PHP 5.5).

使用未定义的常量MCRYPT_BLOWFISH( Apache 2.4, PHP 5.5)。

php -m returns mcrypt.

php -m 返回 mcrypt。

ls -al /etc/php5/apache2/conf.d/
20-mcrypt.ini -> ../../mods-available/mcrypt.ini

cat /etc/php5/mods-available/mcrypt.ini
; configuration for php MCrypt module
extension=mcrypt.so
ls -al /etc/php5/apache2/conf.d/
20-mcrypt.ini -> ../../mods-available/mcrypt.ini

cat /etc/php5/mods-available/mcrypt.ini
; configuration for php MCrypt module
extension=mcrypt.so

Why is mcryptnot recognized? How can I make this work?

为什么mcrypt不被认可?我怎样才能使这项工作?

回答by phazei

No sooner do I speak do I find a solution, heh.

我一开口就找到解决办法,呵呵。

This worked for me: mCrypt not present after Ubuntu upgrade to 13.10

这对我有用Ubuntu 升级到 13.10 后不存在 mCrypt

needed to go: sudo php5enmod mcrypt

需要去: sudo php5enmod mcrypt

even though it appeared to already be enabled, that fixed it.

即使它似乎已经启用,也修复了它。

回答by John Yin

When I try to enable the Express Paypal method, I came across this error.

当我尝试启用 Express Paypal 方法时,我遇到了这个错误。

Error: Use of undefined constant MCRYPT_BLOWFISH- assumed MCRYPT_BLOWFISHin /var/www/.../lib/Varien/Crypt/Mcrypt.phpon line 56

错误:使用未定义的常量MCRYPT_BLOWFISH- 假设MCRYPT_BLOWFISH/var/www/.../lib/Varien/Crypt/Mcrypt.php第 56 行

Firstly, we can run this cmd to check the mcryptis running or not:

首先,我们可以运行这个cmd来检查mcrypt是否正在运行:

php --ri mcrypt

If mcryptis not enabled, we can use the following to enable it as others mentioned

如果mcrypt没有启用,我们可以像其他人提到的那样使用以下方法启用它

sudo php5enmod mcrypt

As well, we had better check php5-mcryptpackage is installed or not

同样,我们最好检查php5-mcrypt软件包是否安装

dpkg -l | grep php5-mcrypt

While if you install fastcgiand php-fpmlike us, we have to restart the php-fpmservice, and apache2service as well.

如果您安装fastcgiphp-fpm喜欢我们,我们必须重新启动php-fpm服务,以及apache2服务。

sudo service apache2 restart
sudo service php-fpm restart