1 (edited by ritteh 2020-02-20 19:49:12)

Topic: php-fpm vs mod_php

Hi,

I'm trying to install PHP 7.4 on a CentOS 8 server. I've previously installed PHP 7.2 on CentOS 6. I notice that PHP 7.4/CentOS 8 install uses php-fpm as opposed to mod_php as it used to. What are the benefits of using php-fpm over mod_php? (Every time I've benchmarked the two, php-fpm was slower.) Is there a way to use mod_php instead?

For reference, here is how I'm installing PHP 7.4 on CentOS 8:

dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf -y module enable php:remi-7.4
dnf install php php-mysqlnd

Re: php-fpm vs mod_php

Some info about "why" on https://developers.redhat.com/blog/2017 … tion-tips/

> Is there a way to use mod_php instead?

Yes, switching Apache HTTP server to use the old  "prefork" MPM
But you'll have to get rid of the benefit of a thread web server and of http2.

To be honest, I think mod_php is a dead thing, nobody should use it anymore.

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