Multiple PHP version and switching from PHP-FPM cu FCGId

Let’s say you have more than one PHP version installed in your system. In my case 5.6 and 7.0. I am using in my virtual hosts 7.0 version. Virtualmin is allowing me to switch PHP versions in a section. It is a good feature.

When you switch FCGId to PHP-FPM in Virtualmin your PHP version will be the one you used in FCGId, in my case PHP 7.0. In case you switch back from PHP-FPM to FCGId, Virtualmin will set up PHP version to the lowest one. I discovered it was not 7.0 after switching back, it was 5.6. I had to go in PHP Versions section and select PHP 7.0 in order to keep the virtual hosts with same configuration.

I don’t know why Virtualmin is not keeping the same PHP version when switching from PHP-FPM to FCGId. Please pay attention when doing this in Virtualmin and what PHP version will be loaded after. I suggested this in Issues section but someone closed and marked it as fixed. This could create trouble and I consider it a bug.

I can do this by my own but other cannot do it.

For both of you questions i think Virtualmin is on with those.

But see yourself you can test
https://github.com/virtualmin/virtualmin-gpl/commit/7bcd493e3a410c3daae663082912965af9efeb97#diff-53e2555ae1d19ce86e8126729965b0fb

https://www.virtualmin.com/node/55788

https://github.com/virtualmin/virtualmin-gpl/commit/f035ce887e758d6a21e96f7586a16c9bfc7b4fd3

https://github.com/virtualmin/virtualmin-gpl/commit/3b7c42bab18880d41cea943802ab02e91f61421b