一上班,就收到研发提出网站出现“Call to undefined function mcrypt_create_iv()”
上网查下是没有安装mcrypt模块。
搜索一下,网上大多方法都是安装mcrypt模块要重新编译php,可我的系统在线运行着,不方便编译。
以下是我的处理过程:
环境:rhel 5 +php5.3,已有yum
#yum -y install libmcrypt libmcrypt-devel php-mcrypt php-mbstring
查找相关文件
#updatedb
#locate mcrypt.so
/usr/local/php5/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so
#locate libmcrypt
/usr/local/bin/libmcrypt-config
/usr/local/lib/libmcrypt
/usr/local/lib/libmcrypt.la
/usr/local/lib/libmcrypt.so
/usr/local/lib/libmcrypt.so.4
/usr/local/lib/libmcrypt.so.4.4.8
有了这两个资料,就可以在php.ini上增加mcrypt模块
#locate php.ini
/usr/local/php5/lib/php.ini
#vi /usr/local/php5/lib/php.ini
增加两行
extension=mcrypt.so
; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt)
;mcrypt.modes_dir=
mcrypt.modes_dir=/usr/local/lib/
:wq 保存退出
要重启apache
阅读(14330) | 评论(0) | 转发(0) |