1 (edited by meadownix 2022-04-08 14:29:01)

Topic: php-fpm assumes I'm using apache?

Just installed php-fpm from the php-8.0 remi-repo (on almalinux) and noticed that the default user and group are set to "apache" which also leads to creating folders under /var/lib/php(opchache,session,wsdlcache) with apache as the owner.
I personally don't use apache on my server so I think it is unnecessary to have a user called apache.
I also don't know what the default user should be, maybe a more neutral www-data?
Or is there a reason why apache is the default user?
I'm also aware that it might be impossible to change this setting on a package level now without breaking many existing installations. which could be the reason it is still set to apache? smile

Re: php-fpm assumes I'm using apache?

simply consider "apache" to be the "www-data" of other distro.

Historically "apache" was the user of the httpd webserver, of thus the user running php script (mod_php)

So, packaged applications (Wordpress, phpMyAdmin...) rely on this setting for folder permissions (most of scripts being owned by "root", so read-only for the web-server)

Using php-fpm we keep this settings.

Everything work out of the box (httpd + php-fpm or nginx + php-fpm), including the web app.

Changing the name will be a "big" change, implying fixing all app, breaking all configuration, for a very low benefit.

So no change planed.

It is perfectly fine to run web server on some user (e.g. nginx) and PHP on another (e.g. apache)

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