无法为CentOS 7安装mcrypt使用php-common-5.4.16

我试过安装mcrypt,我收到一个错误(下面)。 基本上错误说我有PHP的错误版本(据我所知)。 我在这里看到过类似的post:

无法安装php-mysql模块

但我不清楚如何(如果可能)重新调解这个问题,并得到mcrypt安装。

我已经检查了一些如何安装php-mcrypt的来源; 一个例子是:

https://stackoverflow.com/questions/25919595/how-to-install-mcrypt-php-extension-on-centos-7-0-x64

我得到的错误:

[root@blogs-etal-1 steinholland.com]# sudo yum -y install php-mcrypt Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: centos.mirror.nac.net * epel: mirrors.mit.edu * extras: mirror.cc.columbia.edu * remi-safe: remi.mirrors.cu.be * updates: linux.cc.lehigh.edu Resolving Dependencies --> Running transaction check ---> Package php-mcrypt.x86_64 0:5.3.3-4.el6 will be installed --> Processing Dependency: php(zend-abi) = 20090626 for package: php-mcrypt-5.3.3-4.el6.x86_64 --> Processing Dependency: php(api) = 20090626 for package: php-mcrypt-5.3.3-4.el6.x86_64 --> Processing Dependency: libmcrypt.so.4()(64bit) for package: php-mcrypt-5.3.3-4.el6.x86_64 --> Running transaction check ---> Package libmcrypt.x86_64 0:2.5.8-9.el6 will be installed ---> Package php-mcrypt.x86_64 0:5.3.3-4.el6 will be installed --> Processing Dependency: php(zend-abi) = 20090626 for package: php-mcrypt-5.3.3-4.el6.x86_64 --> Processing Dependency: php(api) = 20090626 for package: php-mcrypt-5.3.3-4.el6.x86_64 --> Finished Dependency Resolution Error: Package: php-mcrypt-5.3.3-4.el6.x86_64 (epel) Requires: php(api) = 20090626 Installed: php-common-5.4.16-23.el7_0.3.x86_64 (@base) php(api) = 20100412-64 Available: php-common-5.4.16-36.el7_1.x86_64 (base) php(api) = 20100412-64 Error: Package: php-mcrypt-5.3.3-4.el6.x86_64 (epel) Requires: php(zend-abi) = 20090626 Installed: php-common-5.4.16-23.el7_0.3.x86_64 (@base) php(zend-abi) = 20100525-64 Available: php-common-5.4.16-36.el7_1.x86_64 (base) php(zend-abi) = 20100525-64 You could try using --skip-broken to work around the problem You could try running: rpm -Va --nofiles --nodigest 

你正在运行CentOS 7,但是你为CentOS 6安装了EPEL。这显然不起作用。 将其删除并重新安装CentOS 7的EPEL。

 yum reinstall epel-release