#######################################################
安装PHP的Mcrypt扩展模块
#######################################################
MCrypt是一个用来替代旧的crypt()套件和crypt(1)命令的扩展,它允许开发人员使用范围广阔的加密函数,
而无需大动作修改他们的代码,它还允许用户在没有解密机制的情况之下加密文件和数据流.Libmcrypt是伴随
MCrypt而来的,它自身含有真正的加密函数, 因而可以提供一个访问它们的标准化机制.
=========
直接安装套件的方法
=========
yum install php-devel;
yum install libmcrypt;
yum install libmcrypt-devel;
yum install php-mcrypt;
apt-get install php5-mcrypt;
======================
手工自行编译的方法
======================
【首先要安装libmcrypt支持函数库】
yum install libmcrypt libmcrypt-devel; #如安装RPM需Devel开发套件;
wget http://jaist.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.bz2;
tar jxvf libmcrypt-2.5.8.tar.bz2
cd libmcrypt-2.5.8/;
./configure;
make;
make install;
【然后再编译php的扩展模块】
cd /usr/local/php/ext/mcrypt/; #假设您的PHP安装在/usr/local/php/路径下;
cd /usr/include/php/ext/mcrypt/; #如果您安装php-devel套件则一般在此路径下;
++++++++++++++++++++++++++++++++++++++++++++++++++
如果php-devel的rpm套件资源中没有mcrypt的扩展模块资源,则需从网络上下载php的资源.
参考下载资源的网络链接:http://www.php.net/releases/
wget http://hk2.php.net/get/php-5.3.2.tar.gz/from/this/mirror;
wget http://hk2.php.net/get/php-5.2.13.tar.gz/from/this/mirror;
wget http://museum.php.net/php5/php-5.1.6.tar.bz2;
wget http://hk2.php.net/get/php-4.4.9.tar.gz/from/this/mirror;
wget http://museum.php.net/php4/php-4.3.11.tar.gz;
wget http://museum.php.net/php4/php-4.3.9.tar.gz;
+++++++++++++++++++++++++++++++++++
phpize
./configure
make
make install
ll /usr/lib/php/modules/mcrypt.so;
【跟着还需要在PHP中配置mcrypt支持】
可以在编译PHP的时候直接加上with-mcrypt选项,如果 不想重新编译PHP,也可以在PHP的配置文档php.ini
中加入扩展模块,例如: vim /usr/local/lib/php.ini;
-----------------------------------------------------
extension=mcrypt.so
------------------------------------------------------
【最后重启Web服务和检测扩展模块】
service httpd restart;
php -i | grep mcrypt
php --re mcrypt;
+++++++++++++++++++++++++++++++++++++++++
+ 参考:安装mcrypt软件
+ ===================================
+ 如果新版Mcrypt需要新的mhash,可在这里下载和安装:
+ 参考网站: http://mhash.sourceforge.net/
+ 下载资源: http://sourceforge.net/project/showfiles.php?group_id=4286
+ wget http://jaist.dl.sourceforge.net/sourceforge/mhash/mhash-0.9.9.tar.gz;
+ tar zxvf mhash-0.9.9.tar.gz;
+ cd mhash-0.9.9/;
+ ./configure;
+ make;
+ make install;
+ ----------------------------------------------------------------------------
+ 参考网址: http://mcrypt.sourceforge.net/
+ 下载资源: http://sourceforge.net/project/showfiles.php?group_id=87941
+ wget http://nchc.dl.sourceforge.net/sourceforge/mcrypt/mcrypt-2.6.7.tar.gz;
+ tar zxvf mcrypt-2.6.7.tar.gz;
+ cd mcrypt-2.6.7/;
+ LD_LIBRARY_PATH="/usr/local/lib" ./configure;
+ make;
+ make install;
+++++++++++++++++++++++++++++++++++++++++