PHP編譯安裝報錯: mcrypt.h not found. Please reinstall libmcrypt.

來源:互聯網
上載者:User

標籤:

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.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.