Submitted by fuscata on Thu, 08/14/2014 - 14:20
The fact that this line is commented out by default in /etc/mime.types:
#application/x-httpd-php phtml pht php
is causing headaches. Could you add a test for it in the configuration check please?
See https://www.virtualmin.com/node/27971
Thanks!
Status:
Closed (fixed)
Comments
Submitted by andreychek on Thu, 08/14/2014 - 14:49 Comment #1
Howdy -- that issue doesn't seem to occur on all setups, and I haven't run into problems with that on my test systems.
However, as you indicated, there are definitely a few folks who are seeing that.
Does that affect all PHP Execution Modes? Or just one or two of them?
Submitted by JamieCameron on Thu, 08/14/2014 - 17:48 Comment #2
Perhaps we could deal with this by putting an
AddType
directive into theVirtualhost
block to remove any dependency on the mime.types file.Submitted by fuscata on Sat, 08/16/2014 - 16:36 Comment #3
Does that affect all PHP Execution Modes?
Just mod_php.
Perhaps we could deal with this by putting an AddType directive into the Virtualhost block
Just confirmed that this works.
Submitted by JamieCameron on Sun, 08/17/2014 - 00:55 Comment #4
Eric - any reason you can think of not to have a directive like
AddType application/x-httpd-php5 .php
when in mod_php mode? In my brief tests, this seemed to work OK.Submitted by andreychek on Sun, 08/17/2014 - 19:26 Comment #5
Jamie, after some additional testing, I was able to reproduce this issue on a freshly installed Ubuntu 14.04 system.
I wasn't able to resolve it using the AddType you mentioned, though the following one did appear to fix it:
AddType application/x-httpd-php .php
That is, "application/x-httpd-php5" didn't work, it needed to be "application/x-httpd-php". Though it didn't hurt to have both entries listed there.
In the solution you're suggesting, the "AddType" directive would just be when using mod_php, and would be removed when switching to CGI or FCGID? I can't think of any problems in doing that.
Submitted by JamieCameron on Sun, 08/17/2014 - 22:46 Comment #6
Ok, I've added code to add the directive
AddType application/x-httpd-php .php
, but only for mod_php and cgi modes (for which it was already being added).What's odd is that on my test system, Virtualmin never needed this - however, this is an older Apache release.
Submitted by andreychek on Mon, 08/18/2014 - 00:09 Comment #7
I at first thought this must have just been an Ubuntu 14.04 issue, but you mentioning Apache 2.4 got me wondering if it might be Apache related, and not distro related.
And indeed, it is Apache related!
CentOS 7, which ships with Apache 2.4, has this same problem. Any website on CentOS 7 configured to use mod_php won't work properly, until the above "AddType" entry is added.
Once that entry is added into the Apache config for that domain, mod_php begins working properly.
Submitted by Issues on Mon, 09/01/2014 - 00:11 Comment #8
Automatically closed -- issue fixed for 2 weeks with no activity.