How can I enable PHP FCGId mode on AlmaLinux 10?

SYSTEM INFORMATION
OS type and version AlmaLinux 10.2
Webmin version 2.641
Virtualmin version 8.1.0 GPL
Webserver version Apache 2.4.63
Related packages SUGGESTED

Hello,

I installed Virtualmin on a new AlmaLinux 10 server, but I cannot select FCGId as a PHP execution mode. Only FPM are available.

I checked the Virtualmin source and it looks like FCGId is only added as a PHP mode when suexec is detected as usable:

push(@cgimodes, “fcgid”) if (&indexof(“suexec”, @hascgi) >= 0);

On this server, Apache and Webmin both seem to detect mod_suexec and mod_fcgid correctly:

httpd -M | grep -i suexec
suexec_module (shared)

/etc/webmin/apache/site includes:
mod_suexec
mod_fcgid

However, /usr/sbin/suexec -V shows:

-D AP_DOC_ROOT=“/var/www”
-D AP_USERDIR_SUFFIX=“public_html”

Virtualmin is configured with:

home_base=/home

My existing Ubuntu 20.04 Virtualmin server uses apache2-suexec-custom, and its suexec config allows /home:

/etc/apache2/suexec/www-data:
/home
public_html

On the existing server, Virtualmin creates virtual hosts like this:

/home/example.jp/domains/sub.example.jp/
fcgi-bin/
cgi-bin/
public_html/

The PHP FCGId wrappers are under fcgi-bin, for example:

/home/example.jp/domains/sub.example.jp/fcgi-bin/php8.4.fcgi

So on AlmaLinux 10, the default suexec AP_DOC_ROOT=/var/www does not allow Virtualmin’s /home based fcgi-bin paths.

My questions are:

  1. What is the recommended way to make PHP FCGId mode available in Virtualmin on AlmaLinux 10?
  2. Is there an official or recommended suexec package for AlmaLinux/RHEL that supports Virtualmin’s /home based layout?
  3. Should I rebuild suexec/httpd-core with AP_DOC_ROOT=/home, or is there a better supported approach?
  4. Is PHP FCGId with per-directory PHP version switching still supported/recommended on AlmaLinux 10, or should this be migrated to PHP-FPM somehow?

The reason I need FCGId is not specifically FCGId itself, but the existing server uses directory-level PHP version switching within the same virtual host. I would like to migrate the existing system with minimal changes.

Any advice on the supported/recommended approach would be appreciated.

Thank you.

You shouldn’t.

You should stick with the same OS, in that case. There are necessary changes when changing operating systems. Debian/Ubuntu has a suexec-custom package, which allows changing the suexec docroot at runtime. EL distros don’t have that. We used to include a custom Apache package to allow it, but now that there’s FPM, which is better in pretty much every instance, there’s no good reason to replace the system Apache.

But, it’s pretty unusual to actually need a bunch of different PHP versions. Most apps get updated to work with current versions…so, maybe just update your apps? It’s not really safe to run old applications these days with LLMs finding security bugs every day in every web app on the planet.

Thank you for your advice.
I’ve come to think it may be more practical to invest the effort in updating the application to run correctly on PHP 8.3 and use PHP-FPM, rather than trying to preserve and maintain this unusual setup.
Thank you again for your help and clarification.

I’ll mention that supporting multiple PHP versions in a single domain is on our todo list, it’s just a bigger change than we’re comfortable making in a rush. The changes are the same ones that need to happen to make resource limits work correctly for PHP apps, so there’s a pretty strong motivation to get it done, but it’s also big and likely to cause breakage if we’re not very careful about it.