在 Centos 6 上安装 php-mcrypt

在 Centos 6 上安装 php-mcrypt

我正在尝试在我的 Centos 6.0、64 位、php 5.3.3 上安装 php-mcrypt。我正在使用 epel repo rpm -Uvh http://download.fedora.redhat.com/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm,这是最后一个。

但我运行后yum install php-mcrypt出现错误

   [root@CentOS-60-64-minimal ~]# yum install php-mcrypt
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos.kiewel-online.ch
 * epel: mirror.fraunhofer.de
 * extras: centos.kiewel-online.ch
 * rpmforge: ftp-stud.fht-esslingen.de
 * updates: centos.kiewel-online.ch
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:5.1.6-5.el5 will be installed
--> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.x86_64
--> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.1.6-5.el5.x                                     86_64
--> Running transaction check
---> Package libmcrypt.x86_64 0:2.5.7-5.el5 will be installed
---> Package php-mcrypt.x86_64 0:5.1.6-5.el5 will be installed
--> Processing Dependency: php-api = 20041225 for package: php-mcrypt-5.1.6-5.el5.x86_64
--> Finished Dependency Resolution
**Error:** Package: php-mcrypt-5.1.6-5.el5.x86_64 (epel)
           **Requires: php-api = 20041225**
           Installed: php-common-5.3.3-3.el6_1.3.x86_64 (@updates)
               php-api = 20090626
           Available: php-common-5.3.3-3.el6.x86_64 (base)
               php-api = 20090626
 You could try using --skip-broken to work around the problem

为什么 epel 没有给我最新的 mcrypt?php-mcrypt-5.1.6-5.el5.x86_64 不是 repo 上的最新版本...我该怎么办?

答案1

软件包 php-mcrypt.x86_64 0:5.1.6-5.el5 将被安装

注意el5,这意味着该包是从 EL5 仓库中提取的。确保epel-release-6-5.noarch.rpm已成功安装:

$ rpm -qa | grep epel
epel-release-6-5.noarch

并且mirrorlist(在 中/etc/yum.repos.d/epel.repo) 指向正确的路径:

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

epel-6代替epel-5

答案2

如果将来有人遇到这种情况我会这样做:

删除了之前的 EPEL 安装。 yum remove epel-release

然后安装CentOS 6的最新版本。

$ cd /tmp

$ wget http://mirror-fpt-telecom.fpt.net/centos/6.6/extras/x86_64/Packages/epel-release-6-8.noarch.rpm

$ rpm -ivh epel-release-6-8.noarch.rpm

从那时起,我只需运行yum install php-mcrypt命令,php-mcrypt 就安装正常了。

答案3

您可以尝试这个:

获得http://dag.wieers.com/rpm/packages/libmcrypt/libmcrypt-2.5.7-1.2.el6.rf.x86_64.rpm

获得http://dag.wieers.com/rpm/packages/libmcrypt/libmcrypt-devel-2.5.7-1.2.el6.rf.x86_64.rpm

rpm -Uvh libmcrypt-*.rpm

我使用这个很长时间了,没有任何问题。

相关内容