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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP编译安装报错: mcrypt.h not found. Please reinstall libmcrypt.相关的知识,希望对你有一定的参考价值。

php编译安装报错: mcrypt.h not found. Please reinstall libmcrypt.

转载2016-04-25 12:40:44
标签:linuxitphp

解决方法:

1.为系统安装perl-Geo-IP,默认yum源中没有这个包,特意安装epel第三方yum源[[email protected] ~] rpm -Uvh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

?Retrieving http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

warning: /var/tmp/rpm-tmp.BM4bHz: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]   

1:epel-release           ########################################### [100%]

?2.[[email protected] ~]#yum install -y libmcrypt-devel

[[email protected] ~]#Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again?

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

转载2016-04-25 12:40:44
标签:linuxitphp

解决方法:

1.为系统安装perl-Geo-IP,默认yum源中没有这个包,特意安装epel第三方yum源[[email protected] ~] rpm -Uvh http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

?Retrieving http://mirrors.sohu.com/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm

warning: /var/tmp/rpm-tmp.BM4bHz: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing...                ########################################### [100%]   

1:epel-release           ########################################### [100%]

?2.[[email protected] ~]#yum install -y libmcrypt-devel

[[email protected] ~]#Error: Cannot retrieve metalink for repository: epel. Please verify its path and try again?

这里我们又遇到一个错误,解决方法:

解决办法是编辑/etc/yum.repos.d/epel.repo,把基础的恢复,镜像的地址注释掉

#baseur

lmirrorlist

改成

baseurl

#mirrorlist

步骤如下:(蓝色为需修改的地方)

? [[email protected] ~]# vi /etc/yum.repos.d/epel.repo

[epel]

name=Extra Packages for Enterprise Linux 6 - $basearch

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch

#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch

failovermethod=priority

enabled=1

gpgcheck=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-debuginfo]

name=Extra Packages for Enterprise Linux 6 - $basearch - Debug

baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug

#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch

failovermethod=priority

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

gpgcheck=1

?[epel-source]

name=Extra Packages for Enterprise Linux 6 - $basearch - Source

baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS

#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch

failovermethod=priority

enabled=0

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

gpgcheck=1

修改完之后保存退出。?

 

上面下划线部分错误,是原博主遇到的错误及解决办法。  而我遇到的则是这个错误

Error:Cannot retrieve repository metadata (repomd.xml) for repository: rpmforge. Please verify its path and try again

解决办法是

yum Error: Cannot retrieve repository metadata (repomd.xml) for repository:xxxxxx.

这个错误其实很简单,错误信息已经提示你,就是xxxxxx.repo这个文件有问题。

(1)打开/etc/yum.repos.d/xxxxxx.repo文件

(2)enabled=1(可能有多个,具体改几个,有待测试。 我当时遇到的是第一个需要改。 改了就成功了。)改成enabled=0

 

3.再次运行?yum install -y libmcrypt-devel

Installed:libmcrypt-devel.i686 0:2.5.8-9.el6 #安装完成

4.?[[email protected] src]# cd php-5.3.27 

    [[email protected] php-5.3.27]# ./configure \ --prefix=/usr/local/php \ --with-apxs2=/usr/sbin/apxs \ --with-config-file-path=/usr/local/php/etc \ --with-mysql=/usr/local/mysql \ --with-libxml-dir \ --with-gd \ --with-jpeg-dir \ --with-png-dir \ --with-freetype-dir \ --with-iconv-dir \ --with-zlib-dir \ --with-bz2 \ --with-openssl \ --with-mcrypt \ --enable-soap \ --enable-gd-native-ttf \ --enable-mbstring \ --enable-sockets \ --enable-exif \ --disable-ipv6

??Thank you for using PHP.

[[email protected] php-5.3.27]# echo $?

0

参考:

http://blog.sina.com.cn/s/blog_b5dfe4870102wasu.html#commentComment

http://blog.csdn.net/sissiyinxi/article/details/7595617

 

感谢俩位博主。

 

以上是关于PHP编译安装报错: mcrypt.h not found. Please reinstall libmcrypt.的主要内容,如果未能解决你的问题,请参考以下文章

解决php编译报错configure: error: mcrypt.h not found. Please reinstall libmcrypt.

解决php编译报错configure: error: mcrypt.h not found. Please reinstall libmcrypt.

mcrypt.h not found. Please reinstall libmcrypt”的解决方法

配置 php 5.6 配置时出错:错误:找不到 mcrypt.h。请重新安装 libmcrypt

如何安装 mcrypt 并将 mcrypt.h 添加到我的 C 程序文件中?

CentOS7编译安装OpenSSL1.1.1f