One subsite giving PHP download while others work properly

OS type and version: Ubuntu Linux 20.04.3
Webmin version: 1.984
Virtualmin version: 6.17-3
Related products version: PHP 7.4.3

My server has around 6 subsites. One of those subsites that has an alias is giving a download of PHP files instead of executing them. All the other sites are working fine.

This is almost always caused by having mod_php installed (usually in the php or php7.4-php or similar) package. You should not have mod_php installed.

How could we avoid mod_php when upgrading the PHP form PHP 7.2 to PHP 7.4? Ubuntu 18.04 comes with PHP 7.2.

Don’t install it!

To repeat what I said above: usually in the php or php7.4-php or similar package. That’s mod_php. Just don’t install the damned thing. That’s all there is to not installing mod_php.

We have documentation for installing additional PHP versions, which will also guide you correctly (i.e. by not telling you to install mod_php). Multiple PHP Versions – Virtualmin

If you follow random guides on the internet, you will get yourself into a mess.

Thanks a lot you for that link.

I don’t have it installed.
Attached is the list of packages I have installed.
Installed Packages.log (68.3 KB)

Surprising! OK, in that case try the following:

  1. Validate Virtual Servers.
  2. Change to a different execution mode for a problem site, even if only temporarily, just to see if behavior changes.
  3. Check for leftovers from having mod_php installed. Specifically, any Apache config files that have SetHandlers for php files, other than the ones setup in the Virtualmin-managed vhosts. If you have installed any web apps from the Ubuntu repositories (e.g. phpmyadmin) this is very likely to be a problem.