yum install php-bcmath需要:php-common(x86-64)= 5.3.3-22.el6

时间:2013-03-25 06:54:57

标签: centos centos6

我正在运行centos 6,我试图:

yum install php-bcmath,我收到此错误:

yum install php-bcmath
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.checkdomain.de
 * epel: mirror.de.leaseweb.net
 * extras: mirror.checkdomain.de
 * rpmforge: mirror.de.leaseweb.net
 * updates: mirror.checkdomain.de
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-bcmath.x86_64 0:5.3.3-22.el6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-22.el6 for package: php-bcmath-5.3.3-22.el6.x86_64
--> Finished Dependency Resolution
Error: Package: php-bcmath-5.3.3-22.el6.x86_64 (base)
           Requires: php-common(x86-64) = 5.3.3-22.el6
           Installed: php-common-5.4.9-1.el6.remi.x86_64 (@remi-test)
              php-common(x86-64) = 5.4.9-1.el6.remi
           Available: php-common-5.3.3-22.el6.x86_64 (base)
              php-common(x86-64) = 5.3.3-22.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

请帮忙,

由于

4 个答案:

答案 0 :(得分:5)

我发现问题来自新的PHP版本(5.4,5.4),它安装在一个单独的仓库中。
所以,我们只需要使用命令在主仓库(版本5.3)中安装php-bcmath:

yum install php-bcmath --enablerepo=remi

“remi”是主要的回购,您可以通过 /etc/yum.repos.d 然后使用 ll

看到它

答案 1 :(得分:2)

这可能听起来很愚蠢,但它让我失去了几个小时(是的,我知道......)但不要忘记:

sudo service httpd graceful

后:

yum install php-bcmath

答案 2 :(得分:2)

我的服务器运行PHP 5.6,以下命令解决了我的问题

sudo yum -y install php56-bcmath

sudo service httpd restart

答案 3 :(得分:1)

您可以尝试(适用于Centos 6.4)

rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum install php54w
yum install yum-plugin-replace
yum replace php-common --replace-with=php54w-common
yum install php54w-bcmath

(来源:http://www.webtatic.com/packages/php54/

但它可能会导致版本的另一个问题。

简单的方法是卸载php 5.4(或5.5), 安装php 5.3,安装php-bcmatch然后更新到php5.4(或更新版)