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
Use of undefined constant MCRYPT_BLOWFISH
提问by Ben Rogmans
After reinstalling our server, MCRYPT
is 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 mcrypt
not 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
- assumedMCRYPT_BLOWFISH
in/var/www/.../lib/Varien/Crypt/Mcrypt.php
on line 56
错误:使用未定义的常量
MCRYPT_BLOWFISH
- 假设MCRYPT_BLOWFISH
在/var/www/.../lib/Varien/Crypt/Mcrypt.php
第 56 行
Firstly, we can run this cmd to check the mcrypt
is running or not:
首先,我们可以运行这个cmd来检查mcrypt
是否正在运行:
php --ri mcrypt
If mcrypt
is not enabled, we can use the following to enable it as others mentioned
如果mcrypt
没有启用,我们可以像其他人提到的那样使用以下方法启用它
sudo php5enmod mcrypt
As well, we had better check php5-mcrypt
package is installed or not
同样,我们最好检查php5-mcrypt
软件包是否安装
dpkg -l | grep php5-mcrypt
While if you install fastcgi
and php-fpm
like us, we have to restart the php-fpm
service, and apache2
service as well.
如果您安装fastcgi
并php-fpm
喜欢我们,我们必须重新启动php-fpm
服务,以及apache2
服务。
sudo service apache2 restart
sudo service php-fpm restart