![无法使用 php-common-5.4.16 为 CentOS 7 安装 mcrypt](https://linux22.com/image/676915/%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20php-common-5.4.16%20%E4%B8%BA%20CentOS%207%20%E5%AE%89%E8%A3%85%20mcrypt.png)
我尝试安装 mcrypt,但收到错误(如下)。基本上,错误说我的 PHP 版本错误(据我所知)。我在这里看到过类似的帖子:
但我不清楚如何(如果可能的话)重新解决这个问题并安装 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
答案1
您正在运行 CentOS 7,但安装了适用于 CentOS 6 的 EPEL。这显然行不通。删除它并重新安装适用于 CentOS 7 的 EPEL。
yum reinstall epel-release