Best approach to resolve php-common conflicts: ignore, fix, other?

北城余情 提交于 2019-12-10 13:56:28

问题


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:

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?

I am running php 5.6.3 and CentOS 6 on a VPS


回答1:


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.

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. 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 erase

    and then yum install php56w-soap

  2. 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 erase php-common and then yum install php56w-soap

  3. 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.

    So, install that 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

    and pull the switch: yum replace php --replace-with php56w

    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.

    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.

  4. 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.

    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.

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



来源:https://stackoverflow.com/questions/45559799/best-approach-to-resolve-php-common-conflicts-ignore-fix-other

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!