I can't select the PHP version in CGI

Hi everyone, I apologize if the question has already been asked elsewhere but I really can’t solve a problem related to selecting the PHP version.

The system sees all the PHP versions I have installed and uses them correctly in FPM mode, but by selecting CGI there is no way to change the PHP version.
Unfortunately on some domains I need to use CGI due to processes that cannot interfere with other active services (I miss FCGId so much).

SYSTEM INFORMATION
OS type and version AlmaLinux 8.10
Webmin version 2.202
Virtualmin version 7.30.4
Webserver Apache

Using the system check I can see all the installed versions and no errors.
In the web server configuration I can select the various versions FPM and CGI.
But once you have selected a version (for example 7.4), it continues to put version 8.3.15 (which is the default version of the system) and launches it as apache instead of as a domain user

I was used to using FCGId on Centos 6, but on Almalinux 8 I no longer have this possibility, does anyone know how I could solve the problem? unfortunately a clean reinstallation with another system is not an option.

Thanks in advance!

I get the same thing, maybe a bug. Apache shows as well instead of the domain.

I just tried terminal and typed php -v and its shows the new version that’s selected and I see the config for it.

any reason why your running old versions of php, old versions have security risks.

I tried but nothing changes for me, it continues to show version 8.3 while I’m selecting 7.4… it’s as if it doesn’t save the configuration anywhere

whats php -v show in virtual servers terminal?

Right now 7.2: PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
… and this version is not selected practically anywhere

And 8.3 shows in the GUI? That is weird.

You should remove it if its not run anywhere. Its amazing it is on the system its so old.

The system is a clean installation, unfortunately there are old applications (few thank goodness) that still use 7.*
In this case I can change the default PHP but I cannot change the CGI and 7.4 in a given domain, if i remember well the command is dnf module switch-to php:remi-8.3 or similar (now i’ll check it out)

I can install 7.4 but not 7.2, so still not sure hows its install and why its installed if not used.

proper way to install php on virtualmin, things may break using other methods.

Ok I’ll check now, but for all intents and purposes I used Remi for the installation: Remi's RPM repository
([d] and [e] are random since I’m doing some tests)

Try to stay with virtualmin docs to do things.

Three things:

  • You should not use CGI for production use, it is only useful for testing.
  • CGI is not the same as fcgid.
  • fcgid is no longer available on CentOS or any other RHEL-based OS (and hasn’t been for several years) because we no longer rebuild Apache and RHEL-based distros do not have a suexec-custom package that allows configuring the suexec document root.

You should use FPM, unless you have a very good reason to use something else (and, even if you think you have a good reason, it’s probably not good enough).

I am well aware of the differences between the two modules and that fcgid support has ended in new versions of the operating system.

But in some cases I need CGI because code execution is isolated better than in FPM, or maybe I simply need to test in a directory with a different version, etc.

Apart from the question of who uses what, the problem persists: virtualmin does not save the CGI → version setting

if the OS is EOL
and PHP
then any app that uses them is also EOL or should be updated! or reworked

Yes, true and thank you for all the information, but the problem remains and is another one, virtualmin doesn’t let me save the CGI settings…

As I said at the beginning, this system cannot and will not be changed for now.
Unfortunately this is not my decision and there is nothing I can do about it