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

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
centos7同理:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo


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


[root@xclinux ~]#yum clean all  #清理本地缓存
[root@xclinux ~]#yum makecache #构建缓存



这个时候,执行 yum repolist all显示所有仓库

[root@xclinux ~]# yum repolist all
已加载插件: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
 



PS:最好看看yum详解

https://www.cnblogs.com/vathe/p/6736094.html

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值