Bug 163971

Summary: Files with .php in the middle of the file name are incorrectly interpreted as PHP
Product: [Fedora] Fedora Reporter: Nu Xi <nuxi>
Component: httpdAssignee: Joe Orton <jorton>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: redhat
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-07-22 15:37:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nu Xi 2005-07-22 15:30:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; X11; Linux i686; en) Opera 8.01

Description of problem:
A file with .php in the middle of the filename is sent to the PHP interpreter.  
For example, somefile.php.gz is sent to PHP instead of being downloaded as a 
gzip file.  Note it does not even ungzip it first.  Does the same with somefile.
php.cow.fish.dog and some.file.php.dog.fish.cow as well.

Version-Release number of selected component (if applicable):
httpd-2.0.54-10

How reproducible:
Always

Steps to Reproduce:
1. Create test.php, with any text.
2. gzip test.php
3. try to download test.php.gz

  

Actual Results:  The browser gets 0 bytes.
Notice in the apache error log that it tried to interpret it as PHP.
PHP errors out and returns nothing.

Expected Results:  It should have downloaded test.php.gz as a gzip file.

Additional info:

I recently upgraded from FC2. It previously worked correctly.  The config files 
have not changed, so I assume that the build is different.

Comment 1 Joe Orton 2005-07-22 15:37:07 UTC
This is desired behaviour (useful for example with mod_negotiation); you should
be able to use something like:

  <Files *.php.*>
    RemoveHandler php5-script
    RemoveType text/html
  </Files>

to prevent it, if you like.

Comment 2 Nu Xi 2005-07-22 15:50:05 UTC
Adding that to php.conf does not help.  Adding it to the end of httpd.conf does 
not help.


Comment 3 Nu Xi 2005-07-22 16:03:33 UTC
Adding this to /etc/httpd/conf.d/php.conf does the trick.

<Files "\.php\.">
  RemoveHandler php5-script
  RemoveType text/html
</Files>


Comment 4 Joe Orton 2005-08-01 08:56:06 UTC
*** Bug 164731 has been marked as a duplicate of this bug. ***