Virtualmin says mod_php but phpinfo says FastCGI

Operating system: RHEL
OS version: RHEL 8.3
In the phpinfo page, it says that the server’s API is FPM/FastCGI but in virtualmin it’s not even an option.


Rechecking the configuration says the following about PHP:

SuExec cannot be used to run PHP scripts in CGI or FCGId modes : The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin virtual server home directory is /home. CGI scripts run as domain owners will not be executed.
The following PHP versions are available : 7.3.20 (/bin/php-cgi), 7.3 (mod_php)
The following PHP execution modes are available : mod_php
The following PHP-FPM versions cannot be used : 7.3.20 (No FPM server bootup action found)

Not really sure what to do here as googling yielded nothing, and the relevant forum posts were closed without proper answers.

*I am not using the default PHP version for this version of rhel; I am using PHP 7.3 which I enabled through this kb article

Hi,

Thanks for the heads up.

What is the output of:

dnf list *php* |grep @

Besides, could you DM me the screenshots of that article?

[root@web1 ~]# dnf list *php* |grep @
php.x86_64                    7.3.20-1.module+el8.2.0+7373+b272fdef   @rhel-8-for-x86_64-appstream-rpms
php-cli.x86_64                7.3.20-1.module+el8.2.0+7373+b272fdef   @rhel-8-for-x86_64-appstream-rpms
php-common.x86_64             7.3.20-1.module+el8.2.0+7373+b272fdef   @rhel-8-for-x86_64-appstream-rpms
php-fpm.x86_64                7.3.20-1.module+el8.2.0+7373+b272fdef   @rhel-8-for-x86_64-appstream-rpms
[root@web1 ~]#

I’ve asked Jamie about this in the recent past, but I don’t remember the outcome. There will definitely be discussion here in the forum. I think there is a bug, in Virtualmin somewhere (or installer or something), as mod_php should not even be possible on a CentOS 8 system.

Considering that this dates back to early 2017, are there any known solutions?

I have checked your screenshot, thanks. The problem is that we don’t support modular setups (using dnf module) yet. Besides, we cannot use modular PHP versions per virtual server as they are changed and configured globally.

You should use our official guide to install multiple PHP versions on your server.

However, if you change PHP version using mentioned dnf module command and expect it to work as one global version for all virtual server’s but it doesn’t work, then that might need an extra testing from your side.

@Jamie would that be a lot of work to add support/detection for such configurations, where PHP version can be changed using:

dnf module disable php
dnf module enable php:7.3
dnf update

That’s a completely different problem.

What does it mean to disable a PHP version with the “dnf” command?

Hmm, interesting. I hadn’t heard of the dnf module command until yesterday when I tried to install PHP 7.3. I followed the guide you sent me and this is now the output of Re-Check Configuration in virtualmin: (Only difference being the additional versions)

SuExec cannot be used to run PHP scripts in CGI or FCGId modes : The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin virtual server home directory is /home. CGI scripts run as domain owners will not be executed.
The following PHP versions are available : 7.2.24 (/bin/php-cgi), 7.3.27 (/bin/php73-cgi), 7.4.15 (/bin/php74-cgi), 8.0.1 (/bin/php80-cgi), 7.2 (mod_php)
The following PHP execution modes are available : mod_php
The following PHP-FPM versions cannot be used : 7.2.24 (No FPM server bootup action found) 7.3.27 (No FPM server bootup action found) 7.4.15 (No FPM server bootup action found) 8.0.1 (No FPM server bootup action found)

Website Options still only shows mod_php but the phpinfo page is now 8.0.1:

I thank you for taking the time to help me with this, it means a lot.

@Jamie It’s described here and exampled here.

Hmm, interesting. I hadn’t heard of the dnf module command until yesterday when I tried to install PHP 7.3. I followed the guide you sent me and this is now the output of Re-Check Configuration in virtualmin: (Only difference being the additional versions)

Okay, what exactly have you done, I mean which PHP versions did you install using Virtualmin Multiple PHP versions tutorial? What PHP version did you have installed and configured from stream repo (using dnf module command)?

I installed 7.3, 7.4, and 8.0 following the tutorial.

Before the tutorial, I had PHP 7.3 which I got by following the redhat article. I uninstalled PHP 7.3 by resetting the module and setting the stream to 7.2. The PHP version command says 7.2.24.

I have tried reinstalling the server from scratch but Virtualmin still can not use PHP FPM. All the PHP packages that I have installed are here. The output of re check configuration hasn’t changed much, only now mentioning that mod_php isn’t available.

PHP execution mode mod_php was selected in the default template, but is not supported on this system. Changing the default to .
SuExec cannot be used to run PHP scripts in CGI or FCGId modes : The Suexec command on your system is configured to only run scripts under /var/www, but the Virtualmin virtual server home directory is /home. CGI scripts run as domain owners will not be executed.
The following PHP versions are available : 7.2.24 (/bin/php-cgi), 7.3.27 (/bin/php73-cgi), 7.4.15 (/bin/php74-cgi), 8.0.2 (/bin/php80-cgi)
The following PHP execution modes are available :
The following PHP-FPM versions cannot be used : 7.2.24 (No FPM server bootup action found) 7.3.27 (No FPM server bootup action found) 7.4.15 (No FPM server bootup action found) 8.0.2 (No FPM server bootup action found)

On a side note, is there a way I can change the title of this thread? Virtualmin no longer lists mod_php as an available php execution option so the title should be changed to reflect that.

Did you install the php package (specifically the package named php)? That’s mod_php. It should not be used or installed. I want to make sure we aren’t installing it somewhere/somehow. That’s orthogonal to your problem, I think, but your problem is related to PHP version/runtime detection and I’m trying to make sure mod_php is killed dead. Nobody should ever have it or use it at this point. So, if you did install it, uninstall it. If you didn’t install it, also uninstall it, but tell me, so I can keep looking for why it ended up on your system.

Your problem seems to be a bug in Virtualmin’s detection of available fpm start scripts on CentOS. Can you post the output of rpm -ql php-fpm | grep systemd for each of the versions of PHP you’ve got installed (replace php-fpm with the package name for each php version, you can see them in the list of packages you linke to).

I installed it to see if that would fix anything but it didn’t. I have now uninstalled it.

# rpm -ql php-fpm | grep systemd
/etc/systemd/system/php-fpm.service.d
/usr/lib/systemd/system/httpd.service.d/php-fpm.conf
/usr/lib/systemd/system/nginx.service.d/php-fpm.conf
/usr/lib/systemd/system/php-fpm.service
# rpm -ql php73-php-fpm | grep systemd
/etc/systemd/system/php73-php-fpm.service.d
/usr/lib/systemd/system/httpd.service.d/php73-php-fpm.conf
/usr/lib/systemd/system/nginx.service.d/php73-php-fpm.conf
/usr/lib/systemd/system/php73-php-fpm.service
# rpm -ql php74-php-fpm | grep systemd
/etc/systemd/system/php74-php-fpm.service.d
/usr/lib/systemd/system/httpd.service.d/php74-php-fpm.conf
/usr/lib/systemd/system/nginx.service.d/php74-php-fpm.conf
/usr/lib/systemd/system/php74-php-fpm.service
# rpm -ql php80-php-fpm | grep systemd
/etc/systemd/system/php80-php-fpm.service.d
/usr/lib/systemd/system/httpd.service.d/php80-php-fpm.conf
/usr/lib/systemd/system/nginx.service.d/php80-php-fpm.conf
/usr/lib/systemd/system/php80-php-fpm.service

That looks right, to me. I don’t know why Virtualmin wouldn’t detect those.

@Jamie, do you know what’s going on here? It seems like Virtualmin is ignoring all of the PHP-FPM options (which is bad, because it’s the only possible way to run PHP on a CentOS/RHEL 8 system).

Those systemd actions should be detected, assuming they should up at Webmin -> System -> Bootup and Shutdown.

Where are the FPM pool.d directories on CentOS 8 though? Virtualmin also has to detect them.

Webmin > System > Bootup and Shutdown doesn’t load properly for me:


the text

Ok that’s another problem which would contribute to this issue! Which webmin version are you running?