1,365   Linux PHP

在centos 6 上安装 php-mcrypt 报错

# yum install php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: p3plmirror01.prod.phx3.secureserver.net
* centosplus: p3plmirror01.prod.phx3.secureserver.net
* epel: mirrors.solfo.com
* extras: p3plmirror01.prod.phx3.secureserver.net
* updates: p3plmirror01.prod.phx3.secureserver.net
centosplus                                               | 3.5 kB     00:00
centosplus/primary_db                                    | 746 kB     00:00
Setting up Install Process
No package php-mcrypt available.
Error: Nothing to do

解决方法:
1,安装源

wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm

2,配置 remi 为可用

vi /etc/yum.repos.d/remi.repo

[remi]
......
enabled=1
......

3,更改 epel 路径

[epel]
......
// 去掉注释
baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
// 增加注释
#mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
......

4,最后

yum makecache



Leave a Reply

Your email address will not be published. Required fields are marked *