Bug 163971 - Files with .php in the middle of the file name are incorrectly interpreted as PHP
Summary: Files with .php in the middle of the file name are incorrectly interpreted as...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: httpd
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Joe Orton
QA Contact:
URL:
Whiteboard:
: 164731 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-07-22 15:30 UTC by Nu Xi
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-07-22 15:37:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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. ***


Note You need to log in before you can comment on or make changes to this bug.