linux安装php mcrypt 扩展
1:下载下载Libmcrypt,mhash,mcryp三个安装包
libmcrypt-2.5.8.tar.gz
# wget http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91774&release_id=487459
mhash-0.9.9.tar.gz
# wget http://sourceforge.net/project/showfiles.php?group_id=4286&package_id=4300&release_id=645636
mcrypt-2.6.8.tar.gz
# wget http://sourceforge.net/project/showfiles.php?group_id=87941&package_id=91948&release_id=642101
2:安装libmcrypt
# ./configure --prefix=/usr/local/lib/libmcrypt/ # make # make install
3:安装mhash
# ./configure --prefix=/usr/local/lib/mhash/ # make # make install
4:安装mcrypt
# export LD_LIBRARY_PATH=/usr/local/lib/libmcrypt/lib:/usr/local/lib/mhash/lib # export LDFLAGS="-L/usr/local/lib/mhash/lib/ -I/usr/local/lib/mhash/include/" # export CFLAGS="-I/usr/local/lib/mhash/include"上面三步一定要仔细,最容易出问题的地方就是这里。
# ./configure --prefix=/usr/local/mcrypt --with-libmcrypt-prefix=/usr/local/lib/libmcrypt/ # make # make install
5:php扩展
# cd /usr/local/lnmp/php-5.5.25/ext/mcrypt/ #进入php源文件 # /usr/local/php/bin/phpize # ./configure --with-php-config=/usr/local/php/bin/php-config --with-mcrypt=/usr/local/lib/libmcrypt/ #安装 # make # make install