php / 未分类 · 2012年3月13日

mcrypt install

wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8/
./configure
make
make install
/sbin/ldconfig
cd libltdl/
./configure --enable-ltdl-install
make
make install
cd ../../
wget http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download
tar zxvf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9/
./configure
make
make install
cd ..
##这两个也可以不要
cp /usr/local/lib/libmcrypt.* /usr/lib
ln -s /usr/local/lib/libmhash.so.2 /usr/lib/libmhash.so.2
wget http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download
tar zxvf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8/
ln -s /usr/local/bin/libmcrypt_config /usr/bin/libmcrypt_config
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
##这个可以不用
LD_LIBRARY_PATH=/usr/local ./configure
./configure
make
make install
/usr/local/php/sbin/php-fpm_8001 stop
##php 5.2.6
wget http://museum.php.net/php5/php-5.2.6.tar.bz2
tar -jxvf php-5.2.6.tar.bz2
cd /data/tmp/php-5.2.6/ext/mcrypt
/usr/local/php/bin/phpize
## ./configure --help
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
vi /usr/local/php/lib/php.ini
extension=mcrypt.so
##check
/usr/local/php/bin/php -m
有的话就OK掉, 重启php