找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1315|回复: 1

[站长互助] PHP extension "mcrypt" must be loaded

[复制链接]
发表于 2011-4-12 21:50:01 | 显示全部楼层 |阅读模式
某客户在安装 Magento程序的时候,提示错误 PHP extension "mcrypt" must be loaded.

一般来说,进入ssh,执行 yum -y install mcrypt php-mcrypt 即可安装mcrypt支持,然后service httpd restart 即可。可是,我执行  yum -y install mcrypt php-mcrypt 的时候提示mcrypt 已经安装:

Package php-mcrypt-5.1.6-15.el5.centos.1.i386 already installed and latest version
Nothing to do

于是查看下php的版本:

php -v
PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP    compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
PHP 5.2.17 (cli) (built: Jan  7 2011 21:18:16)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies


发现毛病: php版本是5.2,但是php-mcrypt却是5.1版本,难怪有问题。估计是客户在升级到php5.2的时候,没有正确升级好php-mcrypt。

这里我通过下面的命令升级php-mcrypt:

yum --enablerepo=webtatic --exclude=php*5.3* update -y mcrypt mbstring php-mbstring php-mcrypt

service httpd restart

在测试,一切正常。安装Magento错误PHP extension "mcrypt" must be loaded.搞定。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|王牌互联

GMT+8, 2024-12-21 07:57 , Processed in 0.030782 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表