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

GitHub 加速计划 / li / linux-dash
10.39 K
1.2 K
下载
A beautiful web dashboard for Linux
最近提交(Master分支:1 个月前 )
186a802e added ecosystem file for PM2 4 年前
5def40a3 Add host customization support for the NodeJS version 4 年前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐