Can't set php version with FCGId or CGI Wrapper

SYSTEM INFORMATION
OS type and version Ubuntu 20.04
Webmin version 2.202
Virtualmin version 7.10.0
Webserver version 2.4.41
Related packages SUGGESTED

I have a few identically configured servers, set up to run multiple versions of php. This week I have been working on optimizing them for memory conservation. Up until now, all sites have been running php-fpm regardless of php version requirements. This involves php 7.4, 7.2 and 5.6.

Server 1 has a variety of sites on it, from full production publicly accessible and high volume, to low volume “back end” management apps used only by staff, plus a few “archive” sites showing old versions of “annual data” sites. In order to optimize memory, a few of the low volume sites have been switched to CGI Wrapper configuration using php 5.6, because performance isn’t very important and I’d rather not have fpm processes running for sites that are only accessed by 1 person once a month. This is all working great!

Server 2 is purely an archive and utility site, running mostly old versions of annual data sites and do not need to performance at all. There are several dozen sites requiring php 5.6. Having fpm processes running on all of these sites is a killer, so I want to switch them all to CGI Wrapper. However, I am only able to get 5.6 running using php-fpm; when I switch to fcgid or CGI wrapper, the site uses FPM 7.4. There is a selector for which php to use in FCGID or Wrapper mode, it’s set to 5.6, but still is using FPM 7.4.

If there’s any differences between these two server configurations, I cannot recall what they are. Should be identical.

I’ve run Re-Check configuration on Virtualmin. Everything checks out.

I have restarted Apache.

Here’s my apache directives

SuexecUserGroup “#1006” “#1003
ServerName 2015.subdomain.org
DocumentRoot /home/maindomain/domains/2015.subdomain.org/public_html
ErrorLog /var/log/virtualmin/2015.subdomain.org_error_log
CustomLog /var/log/virtualmin/2015.subdomain.org_access_log combined
ScriptAlias /cgi-bin/ /home/maindomain/domains/2015.subdomain.org/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/maindomain/domains/2015.subdomain.org/public_html>
Options +ExecCGI
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
AddType application/x-httpd-php5.6 .php5.6
AddType application/x-httpd-php7.2 .php7.2
AddType application/x-httpd-php7.3 .php7.3
AddType application/x-httpd-php7.4 .php7.4
AddType application/x-httpd-php5.6 .php
Action application/x-httpd-php5.6 /cgi-bin/php5.6.cgi
Action application/x-httpd-php7.2 /cgi-bin/php7.2.cgi
Action application/x-httpd-php7.3 /cgi-bin/php7.3.cgi
Action application/x-httpd-php7.4 /cgi-bin/php7.4.cgi

<Directory /home/maindomain/domains/2015.subdomain.org/cgi-bin>
allow from all
Require all granted
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.2015.subdomain.org
RewriteRule ^(.) http://2015.subdomain.org:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.2015.subdomain.org
RewriteRule ^(.
) https://2015.subdomain.org:10000/ [R]
RemoveHandler .php
RemoveHandler .php5.6
RemoveHandler .php7.2
RemoveHandler .php7.3
RemoveHandler .php7.4
php_admin_value engine Off

Suggestions?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.