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

Topic: php-fpm vs mod_php


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.

Desktop: Fedora 31 x86_64 + rpmfusion + remi-test + remi-dev
Laptop:  Fedora 30 x86_64 + rpmfusion + remi (SCL only)
Hosting Server: CentOS 6.10 x86_64 with EPEL, remi, remi-php72 and remi-php72-test