Changing PHP execution mode does not work (after installing multiple PHP versions)


I recently installed multiple php versions using popular Ondrei’s repo ( and now whenever I want to change PHP execution mode from FCGId to CGI or mod_php, Virtualmin just “applies” the settings and when I go to Website Options again, I still see FCGId as the selected execution mode, but in fact the execution mode changes, because I see apache config updating and phpinfo page indicates the change as well. In other words, what Virtualmin displays in Website Options is inacurate, because it always indicates the site is in FCGId mode, even when in fact it actually works in mod_php or CGI mode. This has one nasty side effect - I can not switch to FCGId again, so I’m stuck between CGI and mod_php. All I can do now is to check mod_php, then check FCGId again and apply settings, but Virtualmin tells me no changes have been made and that’s how I’m stuck…

I’m on Ubuntu 16.04, and I was using the default PHP version provided by Ubuntu (7.0.x) before the upgrade. After adding Ondrei’s repo, I have 5.6, 7.0, 7.1, 7.2. I also replaced 7.0 with the one provided from Ondrei’s repo, so I don’t use Ubuntu’s version of PHP anymore. Everything runs clean there is no apparent errors in the system, like apt did not freak out with dependencies, there are no broken packages reported in the system, it was a smooth and easy change. I can change php versions without problems, but I can’t change execution mode.

What I have tried so far:

  • run Virtualmin’s config check - in the output 4 different PHP versions are reported, no errors.
  • checked /var/webmin/miniserv.error, no errors
  • created a new server template and set mod_php as the default execution mode - creating new site with this template worked and the site was in mod_php mode. Website Options does indicate it is in mod_php as well, but once I change to FCGId, Virtualmin will always display this site is in FCGId mode, so when I change it to mod_php again, the UI does not reflect it and I’m stuck.

Basically looks like something is confusing Vitrtualmin.
Weird behavior I’m observing is the output of virtualmin list-php-versions command:

root@ip-10-0-0-120:~# virtualmin list-php-versions
Version Path

5.6 /usr/bin/php-cgi5.6
7.0 /usr/bin/php-cgi7.0
7.1 /usr/bin/php-cgi7.1
7.2 /usr/bin/php-cgi

Clearly there is some inconsistency there, maybe this is causing issues? I can’t figure out where that 7.0 version with no corresponding path comes from.
Any help will be highly appreciated.


Hello Leszek, i have the same problem. I am working on a solution. I believe Jamie or Eric can help us :wink:
Output of virtualmin list-php-versions command:

  • 5.6 /usr/bin/php-cgi5.6
  • 7.0 /usr/bin/php-cgi7.0
  • 7.1 /usr/bin/php-cgi7.1
  • 7.2 /usr/bin/php-cgi
  • 7.0
Best regards, erdal

I also have same problem

virtualmin list-php-versions
Version Path

5.6 /usr/bin/php-cgi5.6
7.0 /usr/bin/php-cgi7.0
7.1 /usr/bin/php-cgi7.1
7.2 /usr/bin/php-cgi7.2

Good to know I’m not the only one, still hoping for some support from Jamie or Eric :-).

So I “fixed” it. For anyone who has similar issue: current Virtualmin version does not support php7.2, it’s that simple. And the line without path to php-cgi binary in virtualmin list-php-versions represents php version for mod_php. Without php7.2, changing between mod_php, cgi or fcgid works just fine.

I don’t understand how you fixed it :frowning:
Can you explain it a little bit more ?

I am also interested in a fix to this.

I need to run them in fcgid mode and 7.1, 7.2, 7.3 all bomb when they are in that mode. Output of virtualmin list-php-version is:

5 /usr/bin/php5-cgi
5.6 /usr/bin/php-cgi5.6
7.0 /usr/bin/php-cgi7.0
7.1 /usr/bin/php7.1
7.2 /usr/bin/php7.2
7.3 /usr/bin/php7.3

I’m sorry Jicao, fond your reply today, several months later. I’m assuming you don’t need it anymore, but there might be someone else so I will still anwer. The fix was as simple are uninstalling PHP 7.2 entirely. However, today, PHP 7.2 is already officially supported, and I don’t have this issue anymore. So for anyone who might be facing this issue - make sure you are not installing unsupported version of PHP, apparently it causes some weird issues.

Ssears, please check my reply above. I don’t know about PHP 7.3, I doubt it’s officially supported by Virtualmin. If you want to narrow it down, I would uninstall PHP 7.3 and check if it fixes the mode selection issue. I understand you may still need PHP 7.3, but at least you may try to confirm if this is what’s causing it.

same problem here waiting solutions