PHP execution mode disabled but apache is serving pages with PHP-FPM

SYSTEM INFORMATION
OS type and version AlmaLinux 9.5
Usermin version 2.102
Virtualmin version 7.30.4
Theme version 21.20.7
Apache version 2.4.62
Package updates All installed packages are up to date

On this fresh install of Virtualmin, when I set the PHP execution mode to Disabled on one of the virtual servers, I expect to see raw HTML being served when I visit the URL in a browser; however I see the website being served under user apache:

1317938 apache 20 0 296744 54688 43264 S 6.3 0.2 1:55.20 php-fpm

And when I set the PHP execution mode to PHP-FPM, I see:

1419502 peoplesr 20 0 298132 40268 27648 S 2.3 0.1 0:00.13 php-fpm

But soon after, I get a 504 error

Gateway Timeout

The gateway did not receive a timely response from the upstream server or application.

I do have
Maximum memory allocation 128 M
Maximum HTTP POST size 300 M
And yet I get a gateway timeout.

I have the following questions:

  1. Is it safe to run a website under apache rather than under a user?
  2. How and why is this freshly installed Virtualmin system serving pages under apache - PHP-FPM when the PHP execution mode is disabled?

It is not. At least not on a shared hosting system.

Iā€™m surprised disabling all execution modes causes the default php-fpm to be used, there must be some handlers in the Apache config files that ship in the php-fpm package. Iā€™ll have to look into that, as I donā€™t want people being surprised by this potentially dangerous situation.

You can stop/disable the php-fpm service and only use the Virtual Server specific php-fpm instances.

The browser has no useful information. You need to look at the log.

1 Like

Thank you @Joe for your prompt and helpful response.

1 Like

I run Debian 11. I donā€™t know groups by distro, but this might be interesting or related.

www-data 2489828  0.0  0.0 262316  6752 ?        S     2024   0:00 php-fpm: pool www
www-data 2489829  0.0  0.0 262316  6760 ?        S     2024   0:00 php-fpm: pool www

Did you have a chance to look into this, Joe? @calport is working on our server.

It still runs php-fpm even though all virtual serversā€™ execution modes are set to ā€œdisabledā€. When we switch to php-pm mode, after a short period we get ā€œGateway Timeoutā€ and have to restart the server to clear it and switch back to ā€œdisabledā€ which is runs better albeit as user ā€˜apacheā€™.

Maybe the two things are mutually exclusive - there are probably tweaks to php-fpm that we can make and also tweaks to resource intensive scripts.

FYI the previous server was CentOS7 running PHP FCGId.

Any help appreciated.

I didnā€™t say I was going to look at your system/problem. I was waiting on additional information about why running the application as the user is failing.

I will look into making it so that disabling all execution modes actually disables running PHP entirely. But, if yā€™all want my help solving the issue with apps not running, I need to see actual errors. The browser knows nothing useful.