Bug 163971 - Files with .php in the middle of the file name are incorrectly interpreted as PHP
Files with .php in the middle of the file name are incorrectly interpreted as...
Product: Fedora
Classification: Fedora
Component: httpd (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Joe Orton
: 164731 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2005-07-22 11:30 EDT by Nu Xi
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-07-22 11:37:07 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Nu Xi 2005-07-22 11:30:29 EDT
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):

How reproducible:

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 11:37:07 EDT
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

to prevent it, if you like.
Comment 2 Nu Xi 2005-07-22 11:50:05 EDT
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 12:03:33 EDT
Adding this to /etc/httpd/conf.d/php.conf does the trick.

<Files "\.php\.">
  RemoveHandler php5-script
  RemoveType text/html
Comment 4 Joe Orton 2005-08-01 04:56:06 EDT
*** 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.