Topic: Centos 7: php 8.1 dependencies, httpd why ?

Hello,

When I try to install Remi php 8.1 on centos 7.x yum is also installing httpd, why ?  I already have nginx rpm as a web server, I dont understand why php require the apache web server rpm.

Can someone explain why ?

TIA.

Guillaume

Re: Centos 7: php 8.1 dependencies, httpd why ?

The "php" package provides mod_php for httpd, so of course requires httpd

If you don't want httpd, don't install "php" (but php-fpm)

Laptop:  Fedora 40 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: AlmaLinux 8 with EPEL, rpmfusion, remi

Re: Centos 7: php 8.1 dependencies, httpd why ?

thanks Remi,

I tough that php was only the cli and the dependencies... for the php base.

Bye

Re: Centos 7: php 8.1 dependencies, httpd why ?

Notice:

in C8, "php" still provides mod_php, but this one is no more used, php-fpm is used by default, and work out of the box with httpd or nginx

in C9, "php" is only a metapackage(empty) pulling most common SAPI and extensions

So, especially for modern PHP (8.1 here), I recommend to use a more modern version that the old C7

Laptop:  Fedora 40 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: AlmaLinux 8 with EPEL, rpmfusion, remi

5 (edited by burtonalex 2023-01-24 00:58:51)

Re: Centos 7: php 8.1 dependencies, httpd why ?

You can check the dependencies of the PHP package by running yum list --showduplicates php* and look at the dependencies of the package.
It's also worth noting that while it might seem unnecessary to have both Apache and nginx installed, some people prefer to have multiple web servers installed on their system for various reasons, such as load balancing, failover or testing purposes.
In any case, rest assured that you can continue to use nginx as your main web server and Apache won't affect it.
By the way, as an anchor, TuxCare will be cooler if you have both Apache and nginx installed and configured to work together. It will give you more flexibility and options for your web servers.