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

回复 收藏
本帖最后由 十月鱼 于 2016-4-24 23:27 编辑

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/ [img]file:///C:/Users/xc/AppData/Local/Temp/[5UQ[BL(6~BS2JV6W%7DN6[%S.png[/img]

http://mirrors.aliyun.com/repo/epel-6.repo
[img]file:///C:/Users/xc/AppData/Local/Temp/[5UQ[BL(6~BS2JV6W%7DN6[%S.png[/img]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



2016-04-24 23:26 举报
已邀请:
0

maria

赞同来自:

{:6_137:}没有wget,就用curl啊。
0

乐橙306

赞同来自:

[root@xclinux ~]# rm -rf /etc/yum.repos.d/*   

建议尽量用 mv  代替  rm   方便恢复   
0

十月鱼

赞同来自:

maria 发表于 2016-4-25 08:20
没有wget,就用curl啊。

我当时开着两台。直接用一台下载,然后rsync过去了。
curl也可以?长知识了。{:4_91:}
0

十月鱼

赞同来自:

乐橙306 发表于 2016-4-25 09:25
[root@xclinux ~]# rm -rf /etc/yum.repos.d/*   

建议尽量用 mv  代替  rm   方便恢复

用windows用习惯了,没用的总想着删除。。。恩恩 下次长记性了。在删东西上吃勒好多次亏了。
0

Sean.Yuan

赞同来自:

你这个帖很乱。。我没看到你到底,解决了没有?
0

十月鱼

赞同来自:

Sean.Yuan 发表于 2016-6-2 22:49
你这个帖很乱。。我没看到你到底,解决了没有?

解决了。上面有解决步骤,可能我写的比较乱。
0

鲍国亮

赞同来自:

不用换yum源,加一个epel扩展源就好了我的直接安装就好了yum install -y epel-release,注php 5.4.37出现此问题按此办法解决了。

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: