Download application/x-httpd-php instead of running app!

Dear Community,

I’m encountering a weird behavior since this morning with my Virtualmin server: when I connect onto any web applicatio (sub-server), the browser tries to download the .php file instead of running the app.

What I’ve checked so far:

  • All servers are configured to FCGId (run as owner of the virtual server)
  • All /etc/apache2/mods-available/php-xx. conf files look fine (SetHandler application/x-httpd-php and SetHandler application/x-httpd-php-source are commented out)
  • In Webmin > Servers > Apache Webserver > Global configuration > MIME Types, « application/x-httpd-php » does not show

Any help would be greatly appreciated as I cannot access any of my tools!

Thanks in advance,

Asking roughly the same question here. Just that I change comment out the sethandler for php5.conf for the filesmatch for php([345]?| …
All I need to do to get rid of the error is change the website options from fcgid to fpm and back again for it to work.
Just a pain to have to do this for every website when it should work immediately.

Did someone test / noticed what all changed exactly when not working anymore?

The issue of Apache displaying or downloading the code rather than executing it is usually caused by a SetHandler line, that can be corrected with this here:

https://www.virtualmin.com/documentation/system/faq#toc-why-do-my-php-pages-download-or-display-the-source-rathe-VhTQFtUR

I indeed fixed the problem with an expert who probably update this line. No wworking fine, but we don’t what’s the root cause…