解决无法读取 mcrypt 模组的问题

明明已经用 yum 安装 php-mcrypt 了,在登入 phpMyAdmin 时,却出现了错误讯息:

无法读取 mcrypt 模组, 请检查 PHP 设定

执行 php -v ,也出现:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/module.so' - /usr/lib64/php/modules/module.so: cannot open shared object file: No such file or directory in Unknown on line 0
; Enable mcrypt extension module

依照错误讯息,到 /usr/lib64/php/modules/ 查看,确实没有“module.so”,倒是有一个 “mcrypt.so”。

解决方法

编辑 /etc/php.d/mcrypt.ini,将第 2 行的:

extension=module.so

改成:

extension=mcrypt.so

再重新启动 Apache 就好了:

# service httpd restart

安装 php-mcrypt

题外话,如果你的系统中还没有 php-mcrypt,你只是想要安装 php-mcrypt,必须使用 EPEL 或 RPMForge 套件库:

for CentOS 6.x x86:

# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.i686.rpm
# wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

for CentOS 6.x x64

# wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# rpm -ivh rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
# wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

然后就可以用 yum 安装了:

yum install php-mcrypt
  1. No comments yet.

  1. 03/28. 2014

return top

%d 位部落客按了赞: