[root@ www.chinastor.cn ~]# locate php.ini #查找文件
/usr/local/php/php.ini
/usr/local/php/php.ini.default
/usr/src/php-5.2.16/php.ini-dist
/usr/src/php-5.2.16/php.ini-recommended
/usr/src/php-5.3.4/php.ini-development
/usr/src/php-5.3.4/php.ini-production
[root@ www.chinastor.cn ~]#vi /usr/local/php/php.ini.default #查看备份档并找到一下字段
;extension=php_mcrypt.dll
复制至php.ini文件中,启动这个功能
default_socket_timeout = 60
extension=php_mcrypt.dll
[Date]
问题仍然存在
查看apache的错误日志
[root@ www.chinastor.cn ~]# grep mcrypt /usr/local/apache/logs/error_log
PHP Warning: PHP Startup: Unable to load dynamic library './php_mcrypt.dll' - ./php_mcrypt.dll: cannot open shared object file: No such file or directory in Unknown on line 0
下载安装libmcrypt组件
[root@ www.chinastor.cn ftpuser1]# cd /usr/src/
[root@ www.chinastor.cn src]# ls lib*
libmcrypt-2.5.7.tar.gz
[root@ www.chinastor.cn src]# tar -xzvf libmcrypt-2.5.7.tar.gz
[root@ www.chinastor.cn libmcrypt-2.5.7]# mkdir /usr/local/libmcrypt
[root@ www.chinastor.cn libmcrypt-2.5.7]# ./configure --prefix=/usr/local/libmcrypt/
[root@ www.chinastor.cn libmcrypt-2.5.7]# make && make install
重新编译php
[root@ www.chinastor.cn php-5.2.16]# ./configure --prefix=/usr/local/php --enable-mbstring --with-config-file-path=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mcrypt=/usr/local/libmcrypt/
[root@ www.chinastor.cn php-5.2.16]# ls php*
php5.spec php5.spec.in php.gif php.ini-dist php.ini-recommended
[root@ www.chinastor.cn php-5.2.16]# cp php.ini-recommended /usr/local/php/php.ini #创建php配置文件
extension=php_mcrypt.dll
[root@ www.chinastor.cn php]# cp php.ini php.ini.bak #对配置文档进行备份
[root@ www.chinastor.cn php]# rm -rf php.ini
[root@ www.chinastor.cn php]# grep -v ';' php.ini.bak > php.ini #删除 旧的配置文档,并创建新的配置文档
[root@ www.chinastor.cn php]#
重启apache,问题得到解决。
声明: 此文观点不代表本站立场;转载须要保留原文链接;版权疑问请联系我们。