CentOS – Resolve yum Dependency Conflicts with Installed Packages

apache-2.2apache-2.4centosPHPyum

I want to install php 5.6 from the webtatic repo:

yum install php56w php56w-opcache php56w-mysql php56w-mcrypt php56w-pdo php56w-xml

One of the dependencies is httpd:

Installing for dependencies:  httpd               x86_64     
2.2.15-31.el6.centos       updates       824 k

I already have apache 2.4 installed. The problem is that the name of the package of apache is httpd24-httpd

yum list installed | grep httpd
httpd24.x86_64       1-6.el6            @epel-httpd24                           
httpd24-apr.x86_64   1.4.8-2.el6        @epel-httpd24                           
httpd24-apr-util.x86_64
                     1.5.2-5.el6        @epel-httpd24                           
httpd24-httpd.x86_64 2.4.6-5.el6        @epel-httpd24                           
httpd24-httpd-tools.x86_64
                     2.4.6-5.el6        @epel-httpd24                           
httpd24-runtime.x86_64
                     1-6.el6            @epel-httpd24 

How can I tell yum that the package that you are looking for is actually httpd24-httpd instead of httpd? The problem is that httpd as a dependency is unable to install because of the already installed httpd 2.4:

Transaction Check Error:
  file /etc/httpd/conf.d/README from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/conf.d/welcome.conf from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/conf/httpd.conf from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/conf/magic from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/logs from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/modules from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64
  file /etc/httpd/run from install of httpd-2.2.15-31.el6.centos.x86_64 conflicts with file from package httpd24-httpd-2.4.6-5.el6.x86_64

Any solution for this would be appreciated. I think one way is renaming packages; however, I am not familiar with this process (if possible).

Best Answer

Webtatic's php56w on CentOS 5 and 6 is only compiled to support the base httpd 2.2 packages. This is because mod_php is compiled against the base distribution's httpd.

I'd suggest either:

  • using CentOS 7, where php56w there supports httpd 2.4
  • or, while sticking with CentOS 6, using php56w-fpm instead of php56w, which it's fastcgi interface is supported by httpd 2.4's mod_proxy_fcgi
Related Topic