libmcrypt
1、下载libmcrypt
wget https://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar zxvf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure --prefix=/usr/local/libmcrypt
make && make install
添加环境变量:
ln -s /usr/local/libmcrypt/bin/libmcrypt-config /usr/bin/libmcrypt-config
ln -s /usr/local/libmcrypt/lib/libmcrypt /usr/local/lib/libmcrypt
ln -s /usr/local/libmcrypt/lib/libmcrypt.la /usr/local/lib/libmcrypt.la
ln -s /usr/local/libmcrypt/lib/libmcrypt.so /usr/local/lib/libmcrypt.so
ln -s /usr/local/libmcrypt/lib/libmcrypt.so.4 /usr/local/lib/libmcrypt.so.4
ln -s /usr/local/libmcrypt/lib/libmcrypt.so.4.4.8 /usr/local/lib/libmcrypt.so.4.4.8
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
2、安装mhash
tar zxvf mhash-0.9.9.9.tar.gz
./configure --prefix=/usr/local/mhash
make && make install
ln -s /usr/local/mhash/lib/libmhash.a /usr/local/lib/libmhash.a
ln -s /usr/local/mhash/lib/libmhash.so /usr/local/lib/libmhash.so
ln -s /usr/local/mhash/lib/libmhash.la /usr/local/lib/libmhash.la
ln -s /usr/local/mhash/lib/libmhash.so /usr/local/lib/libmhash.so.2
ln -s /usr/local/mhash/lib/libmhash.so.2.0.1 /usr/local/lib/libmhash.so.2.0.1
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
3、安装mcrypt
tar zxvf mcrypt-2.6.8.tar.gz
./configure --prefix=/usr/local/mcrypt
make && make install
/etc/ld.so.conf
/usr/local/lib
ldconfig
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LDFLAGS="-L /usr/local/mhash/lib -I /usr/local/mhash/include/"
export CFLAGS="-I /usr/local/mhash/include/"
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export LDFLAGS="-L/usr/local/mhash/lib -I/usr/local/mhash/include/"
export CFLAGS="-I/usr/local/mhash/include/"
4、查看PHP版本
/usr/local/php5/bin/php -i |grep configure