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

感谢俩位博主。

时间: 2024-08-02 02:50:26

PHP编译安装报错: mcrypt.h not found. Please reinstall libmcrypt.的相关文章

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

我是在CentOS6.5安装php5.5.28这个版本,PHP编译代码如下: ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-gd --with-ico

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

编译安装php时报错的解决方法: 错误一:configure: error: mcrypt.h not found. Please reinstall libmcrypt. 解决办法:需要安装Libmcrypt wget http://softlayer.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.8.tar.gz        tar -zxvf libmcrypt-2.5.8.tar.gz        cd /usr/local/

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

报错内容: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.下载下来安装仍旧报错libmc

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

报错内容: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.下载下来安装仍旧报错libmcr

php5.6.11编译安装报错configure: error: Don't know how to define struct flock on this system

centos 6.8 32位系统下,安装php.5.6.11是出现这个错误 解决办法: 1 2 3 4 vim /etc/ld.so.conf.d/local.conf     # 编辑库文件 /usr/local/lib                       # 添加该行 :wq                                  # 保存退出 ldconfig -v                          # 使之生效 注意事项: 这里添加的库文件路径一定要和你

centos7编译libiconv报错:./stdio.h:1010:1: error: 'gets' undeclared here (not in a function)

如题:配置编译参数通过,在进行 make 的时候报如下错误: In file included from progname.c:26:0: ./stdio.h:1010:1: error: 'gets' undeclared here (not in a function) _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); ^ make[2]: *** [progname.o] Error 1

编译nagios-plugins报错./stdio.h:456:1:

在AWS的EC2上编译nagios-plugins报错: ./stdio.h:456:1: error: 'gets' undeclared here (not in a function) make[4]: *** [localcharset.o] Error 1 make[4]: Leaving directory `/root/nagios-plugins-1.4.16/gl' make[3]: *** [all-recursive] Error 1 make[3]: Leaving di

php编译安装报错

关于timezone报错: It is not safe to rely on the system's timezone settings 报错:It is not safe to rely on the system's timezone settings [[email protected] local]# php -i|grep pdoPHP Warning: Unknown: It is not safe to rely on the system's timezone setting

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

yum install -y epel-releaseyum install -y libmcrypt-devel 原文地址:https://www.cnblogs.com/finnlee/p/8992374.html