Home  >  Article  >  php教程  >  PHP安装mcrypt.so报错 mcrypt.h not found 的解决办法

PHP安装mcrypt.so报错 mcrypt.h not found 的解决办法

WBOY
WBOYOriginal
2016-06-06 19:49:23953browse

报错内容:configure: error: mcrypt.h not found. Please reinstall libmcrypt 网上搜索了很多,包括自带的 yum install libmcrypt libmcrypt-devel,这个是没有效果的。 去SourceForget下载libmcrypt http://sourceforge.net/projects/mcrypt/files/Libmcr

报错内容:configure: error: mcrypt.h not found. Please reinstall libmcrypt

网上搜索了很多,包括自带的 yum install libmcrypt libmcrypt-devel,这个是没有效果的。

去SourceForget下载libmcrypt http://sourceforge.net/projects/mcrypt/files/Libmcrypt/ ,最新版是mcrypt 2.6.7.gz。下载下来安装仍旧报错libmcrypt没有找到!


继续测试,最后安装成功,感觉是版本太高。

方法(关键点在用 2.5.7版本):

#使用wget可以通过以下路径下载
wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz
 
#解压
tar -zxvf libmcrypt-2.5.7.tar.gz 
 
#进入目录
cd libmcrypt-2.5.7
 
#编译(默认安装到/usr/local/lib/)
./configure --prefix=/usr/local/libmcrypt
 
#执行安装
make && make install


再回到PHP-5.5.13解压缩的ext目录的mcrypt里面
phpize

./configure --with-php-config=/usr/local/php5/bin/php-config \

--with-libmcrypt=/usr/lib/libmcrypt

make

make test

make install

vim /etc/php.ini  

#加入extension=mcrypt.so

(2014-6-19 by default7#zbphp.com)




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php wamp 配置虚拟主机Next article:php的$