Changing PHP version to 7.0 into Virtualmin stops processing php files

I am using a testing virtual machine. I started initially installing Debian Jessie + Virtualmin and the default repositories. PHP version used in Jessie is 5.6.39. Everything works as expected, php files are processed according in browser. Then I upgraded the operating system to Debian Stretch, keeping the configuration untouched. No issues found, upgrading process went smooth. Running php -v shows "PHP 7.0.33-0+deb9u1 (cli) (built: Dec 7 2018 11:36:49)". Loading a test php file in browser, version is still 5.6. I went into Virtualmin in Server Configuration -> PHP Versions and for Default HTML directory I choose from Version drop-down list 7.0.33 then I click [Save Versions]. From now on php files are not processed by Apache, becoming downloadable. There are no errors in log files. I went back to Virtualmin PHP Versions in order to revert the PHP Version to 5.6.39. [Saving Versions] it is not reverting the configuration. Still downloading php files in browser. I tried to find out what was changed by Virtualmin in files, but without any luck. Nothing suspicious inside the configurations files. In my opinion this feature is not working as expected creating trouble. I will continue investigation. Those who are upgrading to PHP v7 or having more than one php version should be very careful before going forward.

Status: 
Closed (fixed)

Comments

Thank you for your reply. I already read tons of pages but nobody is offering a proper solution. Commenting that tag "SetHandler application/x-httpd-php" you will get into other issue "mod_fcgid: error reading data from FastCGI server". Switching PHP Version in Virtualmin is dangerous. Once you do it you cannot revert. I really don't understand why is this happening, but keep investigating.

This is a Virtualmin bug. It is not related to the upgrading process from Debian Jessie to Stretch. Now I am working on Jessie installed from scratch plus Virtualmin with one vhost. By default Jessie installs PHP version 5.6.39. I installed manually PHP versions 7.0, 7.1 and 7.2. Just disabling and enabling one of these Apache modules php5, php7.0, php7.1, I could load without any issues php files in browser.

When I use Virtualmin feature mentioned above I cannot load the php files in browser only downloading them. I would like to know what is Virtuamin doing after pressing [Save Versions] button in order to investigate and revert to the original. This feature is no working properly and your users should avoid it till we find what is going wrong.

We don't have a supported method of installing alternate PHP versions on Debian. Some folks have been able to get it working, but the only supported way of installing additional PHP versions is when using CentOS and Ubuntu, as seen here:

https://www.virtualmin.com/documentation/web/multiplephp

That's not a Virtualmin bug that you're seeing though.

It looks like you're using Virtualmin GPL there, if you had any additional questions regarding using alternate PHP versions, it's no problem to get support, but you'd want to do so using the Forums. We monitor the Forums, along with lots of wonderful folks in the community. Thanks!

Is there some graceful way to migrate a server from Debian to Ubuntu?

I'm really kind of surprised that Virtualmin decided to go with Ubuntu rather than Debian since Ubuntu depends on Debian.

Virtualmin supports Ubuntu, Debian, and CentOS.

However, things get tricky when choosing to go with packages that don't come with the distribution that's installed.

In the case of CentOS and Ubuntu, there are third party repositories we've found that with PHP packages that work reliably in a Virtualmin environment.

We have not yet found repositories for Debian that meet those requirements.

If you'd like to switch distributions, there's is information here on performing a migration:

https://www.virtualmin.com/documentation/system/upgrades-and-migrations