So a few hours after posting I found this recent post: https://www.virtualmin.com/node/57240 The original poster is running Ubuntu 18.04 LTS just like me and the solution offered by siwuch seems to work properly for me.
In "/etc/apache2/mods-enabled/php.conf" (replace php with your filename, depending on the php version you're using - in my case it was php7.2.conf) comment out the following two lines:
Restart the apache server via the following command:
sudo service apache2 restart
Now set your webstite to FCGId (Virtualmin -> Server Configuration -> Website options -> PHP script execution mode ) and it should work properly.
I'm putting the solution here, as well, just in case somebody stumbled on this topic from Google. All credit goes to siwuch who posted the fix in the topic I've linked to.
Hello, I am a complete noob to VPS and Virtualmin, so I'd be thankful if I can rely a bit on the community wisdom :).
I've got a VPS from OVH and I installed Ubutnu 18.04 LTS a couple of weeks ago, and it is to be solely used for a few Wordpress websites. So, Virtualmin is pretty awesome and so far I've been able to get by and pass the blocks I've hit with fervorous googling, but this is something I've been banging my head against, for days.
If the "PHP script execution mode" in "Website options" is set to FCGId, i.e. the default option, php files are downloaded instead of executed. Settings it to mod_php, fixes the problem, but then I have a permissions problem with Wordpress - can't update or install plugins. I've to either set permissions of all folders to 777 (which even a noob like me knows is a big no-no) or change the ownership of everything inside the public_html folder to www-data, which I understand is the default Ubuntu user, but from what I've seen, this is also a security risk.
I've read around the web and the Virtualmin forums and have seen this issue is not as unique, but most, if of the solutions are for CentOS and not Ubuntu.
What I've tried:
I'm probably forgetting something but this is the info I can think of. I would be very thankful if somebody has an idea how to fix this. If I understand it correctly, FCGId is the Wordpress friendly mode of PHP script execution.
Thanks in advance.