centos安装PHP扩展,MCrypt加密处理的方法 Libmcrypt支持库mhash安装,shopex报mysqli
没安装前我们看到都是X提示。方法一,适合腾讯云等有yum源的服务器。
centos只需要运行此命令,然后重启web即可解决、
yum -y install php-mcrypt
看图,已经变成勾了
方法二,适合centos无法使用yum的用户。
官方:http://sourceforge.net/projects/mcrypt/files/
http://sourceforge.net/projects/mhash/files/mhash/
需要先安装Libmcrypt支持库才行
wget http://iweb.dl.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz
tar zxf libmcrypt-2.5.8.tar.gz
cd libmcrypt-2.5.8
./configure
make -s
make -s install
cd ..
mhash支持库
wget http://iweb.dl.sourceforge.net/project/mhash/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz
tar zxf mhash-0.9.9.9.tar.gz
cd mhash-0.9.9.9
./configure
make -s
make -s install
cd ..
安装开始
wget http://iweb.dl.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz
tar zxf mcrypt-2.6.8.tar.gz
cd mcrypt-2.6.8
LD_LIBRARY_PATH=/usr/local/lib ./configure
make -s
make -s install
cd ..
wget http://us1.php.net/distributions/php-5.3.29.tar.gz
tar zxf php-5.3.29.tar.gz
cd php-5.3.29
cd ext
cd mcrypt
/vhs/kangle/ext/tpl_php52/bin/phpize
./configure --with-php-config=/vhs/kangle/ext/tpl_php52/bin/php-config
make
make install
我这提示mcrypt.so文件在这个路径
/vhs/kangle/ext/tpl_php52/lib/php/extensions/no-debug-non-zts-20090626
php.ini加入如下
extension = "/vhs/kangle/ext/tpl_php52/lib/php/extensions/no-debug-non-zts-20090626/mcrypt.so"
然后重启即可生效。
/vhs/kangle/ext/tpl_php52/bin/phpize 可能报错。
比如提示:Cannot find autoconf
解决办法:
wget http://ftp.gnu.org/gnu/m4/m4-1.4.9.tar.gz
tar -zvxf m4-1.4.9.tar.gz
cd m4-1.4.9/
./configure && make && make install
cd ../
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.62.tar.gz
tar -zvxf autoconf-2.62.tar.gz
cd autoconf-2.62/
./configure && make && make install
页:
[1]