PHP编译安装报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt

匿名 (未验证) 提交于 2019-12-02 22:11:45

我是在CentOS6.5安装php5.5.28这个版本,PHP编译代码如下:

安装过程不再赘述。因为在编译安装时没有把mcrypt这个扩展编译进去,所以在phpmyadmin里有这样一句提示:

缺少 mcrypt 扩展。请检查 PHP 配置。

另外在独立安装mycrypt扩展时,报错:

configure: error: mcrypt.h not found. Please reinstall libmcrypt.

现在把mcrypt扩展安装过程贴出来,希望对遇到此类问题的朋友有帮助:

========================================

下载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 install

=========================================

下载mhash-0.9.9.9.tar.gz

tar zxvf mhash-0.9.9.9

cd mhash-0.9.9.9

./configrue --prefix=/usr/local/mhash

make

make install

=========================================

tar zxvf mcrypt-2.6.8.tar.gz

cd mcrypt-2.6.8

export LD_LIBRARY_PATH=/usr/local/libmcrypt/lib:/usr/local/mhash/lib

export LDFLAGS="-L/usr/local/mhash/lib -I/usr/local/mhash/include/"

export CFLAGS="-I/usr/local/mhash/include/"

./configure --prefix=/usr/local/mcrypt --with-libmcrypt-prefix=/usr/local/libmcrypt

make

make install

=========================================

cd /usr/local/src/develop/php-5.5.28/ext/mcrypt

/usr/local/php/bin/phpize

--with-mcrypt=/usr/local/libmcrypt

make

make install

因为我在php.ini设置extension_dir = /usr/local/php/extensions,

所以需要执行:

然后在php.ini里面添加:
extension=mcrypt.so
重启php,执行: service php-fpm restart
运行phpinfo(),发现新增了mcrypt扩展项,而且phpmyadmin里面关于mcrypt的提示也不见了。
在安装过程中走了弯路,一度鄙视这种编译安装方式,多亏了这位大神发的帖子帮忙。
详见: http://segmentfault.com/q/1010000000094627

==============================================================

64位Centos报错:
configure: error: Cannot find ldap libraries in /usr/lib.
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!