您的位置:首页 > 运维架构 > Linux

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

2016-04-24 22:41 639 查看
Centos6.5编译php时报错:configure: error: mcrypt.h not found. Please reinstall libmcrypt.

百度上找了很多解决办法,都不能使用。

解决办法:

[root@xclinux php-5.3.27]#  yum install libmcrypt-devel -y     安装libmcryp

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirrors.skyshe.cn

 * extras: mirrors.skyshe.cn

 * updates: mirrors.pubyun.com

Setting up Install Process

No package mcryptlib-devel available.

Error: Nothing to do

以上是常规解决办法。我到这里还不能安装mcrypt。因为yum源里没有这个的包,只能更换yum源。

解决办法:

全部改成阿里云

[root@xclinux ~]# rm -rf /etc/yum.repos.d/*    
执行此操作的时候记得事先装好wget    不然 你就得挂载光盘用rpm装wget了

[root@xclinux ~]# wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-6.repo http://mirrors.aliyun.com/repo/Centos-6.repo  

这条命令的意思是把centos6的repo文件和epel文件同时下载到/etc/yum.repos.d这个目录下

这个时候,执行 yum repolist的结果如下

[root@xclinux ~]# yum repolist

已加载插件:fastestmirror

Loading mirror speeds from cached hostfile

* base: mirrors.aliyun.com

* epel: mirrors.aliyun.com

* extras: mirrors.aliyun.com

* updates: mirrors.aliyun.com
Setting up Install Process
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: