在linux下为php安装mcrypt模块2011-05-17 10:03:08
分类:
一上班,就收到研发提出网站出现“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