解决php常见冲突的最佳方法:忽略,修复,其他? [英] Best approach to resolve php-common conflicts: ignore, fix, other?

查看:173
本文介绍了解决php常见冲突的最佳方法:忽略,修复,其他?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在CentOS 6上的PHP 5.3.3上安装Soap模块(从webtatic PHP 5.6)。当我运行yum命令 yum install php56w-soap 要安装它,我得到以下消息:

I am attempting to install the Soap module (from webtatic PHP 5.6) on PHP 5.3.3 on CentOS 6. When I run the yum command yum install php56w-soap to install it I get the message below:


错误:php56w-common与php-common-5.3.3-49.el6冲突。 x86_64

您可以尝试使用--skip-broken解决此问题

您可以尝试运行:rpm -Va --nofiles --nodigest

Error: php56w-common conflicts with php-common-5.3.3-49.el6.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

我有什么解决方案?我是否应该只运行-跳破,还有其他选择吗?

What are my options to resolve this? Should I just run with --skip-broken, are there other options?

我正在运行VPS上的php 5.6.3和CentOS 6

推荐答案

您正在使用第三方存储库,因此

You're using a third-party repository, so understand you're asking for some pain.

网络回购比某些回购要好,但这并不完美:一方面,那些软件包没有适当地包含过时的东西,依赖和冲突列表,这是我们在特定情况下真正需要的。

The webtatic repo is better than some, but it's not perfect: for one thing, those packages don't properly include an obsoletes, depends, and conflicts list that we really need in this particular case.

通常可以帮助我们的比较逻辑超出了PHP是唯一替代品的认识对于PHP;不是 php56w。因此,它不会为了满足依赖关系而自动抛出现在已经存在的php533堆栈。您必须给它一个适当的提示。

The comparison logic - which normally helps us - is tripping over the knowledge that PHP is the only replacement for PHP; not 'php56w'. So it's not going to automatically toss out the php533 stack that's in place now, just to satisfy dependencies. You have to give it a proper hint.


  1. 在安装备用堆栈之前,请拉出php:查找从5.3安装的所有内容.3软件包,将其简化为名称,然后传递给yum调用:

  1. Pull out php, before installing the alternative stack: find everything installed from the 5.3.3 package, reduce it to the name, and pass it into a yum invocation:

rpm -qa --qf%{name} -%{version} \n \
| grep 5.3.3 \
| sed’s / -5.3.3 $ //’\
| xargs yum擦除

然后

yum install php56w-soap

执行相同操作,但尝试删除 php-common 并希望它将其他所有内容拖出。它应该并且比上面的选项更容易,但是有时不是100%完美。

Do the same but try just removing php-common and hoping it'll drag everything else out. It should, and it's easier than the above option, but it's not 100% perfect sometimes.

yum delete php-common

然后
yum install php56w-soap

特别是如果您有依赖项,则不会/无法删除,这取决于php(并且足够聪明,可以与php56w一起使用),请使用 yum replace插件 IUS 的$ c>。向前走了几步,但可以肯定的是,您现在已经花了几分钱。

Especially if you have dependencies you won't/can't remove, which depend on php (and are smart enough to live with php56w) use the yum replace plugin from IUS . It's a few steps back to go one step forward, but we agree you're arguably already in for a penny now.

因此,请安装
yum install \
https://dl.fedoraproject.org/pub/epel /epel-release-latest-6.noarch.rpm \
https://centos6.iuscommunity.org/ius-release.rpm
yum install yum-plugin-replace

并拉开关:
yum用php56w
替换php --replace-

有时它会抱怨缺少依赖项,因此您需要闭上眼睛并打 y或决定是否可以生活缺少的部分,并保证一旦完成就围绕THEM工作。

It sometimes complains about missing dependencies, and that's where you'll either need to close your eyes and hit 'y' or decide whether you can live with missing pieces and pledge to work around THEM once it's all done. Dependency hell is always self-inflicted.

该命令将为您显示绘制的解决方案的庞大而令人恐惧的列表,因此请仔细查看该列表。应该有道理。准备安装软件时,请像在其他任何yum调用中一样说 y。

The command will present you with a huge and scary list of the solution it's plotted, so look over that list. It should make sense. Say 'y', like in any other yum invocation, when you're ready to install software.

您的最后一个选项,这是一个重要的选择。考虑是要确定您是否准备好并愿意使用第三方存储库,以及它们有时具有的依赖关系问题和不稳定的更新例程。甚至EPEL或SCL都错过了更新(哎呀,现在是php7.1.18吗?),而且我不希望更多的业余爱好者会更好。我实际上期望会更糟。因此,如果您可以接受最少的测试,没有任何支持并且没有太多帮助,那么请继续充电。

Your last option, and this is an important one to consider, is to decide whether you're ready and willing to live with third party repos, and the dependency issues and flaky update routines they sometimes have. Even EPEL or SCL misses updates (ahem. php7.1.18 any time yet?), and I wouldn't expect the more Hobbyist ones to be any better. I'd actually expect much worse. So, if you can live with minimal testing, no support and not much help, then charge on ahead.

否则,请确定您是否可以忍受无聊的库存, Centos 6随附的受支持的,安全的((更多)安全的php 5.3.3)。RHEL/ Centos上认证的所有功能都可以使用,您不会发现安装的每一个额外组件都会分裂更多的依赖项,并且您将如果您可以使用长期发行版支持的产品,而不是上周挤掉一些未经测试的闪亮礼物,便可以在晚上睡得更好。

Otherwise, decide whether you can live with a boring, stock, supported, safe, (more) secure php 5.3.3 that comes with Centos 6. Everything certified on RHEL/Centos will work with it, you won't find yourself splitting more dependency hairs with every additional piece you install, and you'll be able to sleep better at night if you can live with the Long-term Distro-supported version of a product instead of some shiny gift squeezed out last week and barely tested.

但我在25年后变得有偏见:-)

But I've become biased in 25 years :-)

这篇关于解决php常见冲突的最佳方法:忽略,修复,其他?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆