I reported this bug in Issues section, but it was closed and marked as fixed because someone decided I was looking for support. Pretty sad.
Here is the report. I installed Debian Jessie from scratch in a virtual machine then added Virtualmin. I created two virtual hosts both using default PHP version 5.6. I added ondrej/php repository and I was able to install more PHP versions: 7.0, 7.1 and 7.2 and managed to use every of them with my virtual hosts.
Now I set up a virtual host to use PHP 5.6 and the other one to use PHP 7.2. Everything works as expected. All changes made manually in Terminal.
Virtualmin has a feature in “Server Configuration” section called “PHP Versions”. For the first virtual host “Default HTML directory” I changed Version from 5.6.39 to 7.0.33 then clicked [Save Versions] button. From now on if I want to access the website in browser all php files are becoming downloadable. I went back to “PHP Versions” section and changed from 7.0.33 to 5.6.39 and saved. Configuration was not reverted to initial stage. All php files are not processed in browser and still downloadable.
Using this feature, website part of your Virtual Server is becoming compromised. Even I am an advanced system engineer I was not able to find what was going wrong without dedicating a couple of hours. So I tried reporting this and hopping to get help from Virtualmin team. In fact I wanted to know what is happening in background after pressing [Save Versions] button, what files are changed, Apache modules disabled/enabled, and so on.
Someone decided this is a support request. His solution was reading this page: https://www.virtualmin.com/documentation/web/multiplephp. This is a basic level. It teaches you about installing PHP versions and using “PHP Sections” in Virtualmin. I am sorry to say but this is not a solution, in fact it is the start of your nightmare even for a advanced Virtualmin user. Just follow these instructions and your website will become public as php files. Good job.
I will try finding a solution for this issue. Please do not change “PHP Versions” in Virtualmin for your virtual hosts if you are using Debian Jessie or Stretch.