FS#23815 - php/apache: *.php.* files get processed through php interpreter

Attached to Project: Arch Linux
Opened by Einar Lielmanis (spic) - Sunday, 17 April 2011, 21:26 GMT
Last edited by Pierre Schmitz (Pierre) - Wednesday, 20 April 2011, 21:08 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Pierre Schmitz (Pierre)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

When using apache httpd with php-apache, in the default configuration, *.php.* files get passed to php interpreter, even if the real extension is .txt, .gif or whatever.

Creating a file foo.php.txt would be handled by php instead of being displayed as text.

Additional info:
apache 2.2.17-1
php-apache 5.3.6-2

Default configurations.


Steps to reproduce:

Install apache/php as per wiki,

pacman -S apache php-apache
vim /etc/php/conf/httpd.conf
...
LoadModule php5_module modules/libphp5.so
Include conf/extra/php5_module.conf

vim /srv/http/foo.php.txt
<?php
echo "this is php";

/etc/init.d/httpd start

curl http://localhost/foo.php.txt

Expected:
<?php
echo "this is php";

Observed:
this is php
This task depends upon

Closed by  Pierre Schmitz (Pierre)
Wednesday, 20 April 2011, 21:08 GMT
Reason for closing:  Fixed
Comment by Jan de Groot (JGC) - Monday, 18 April 2011, 07:35 GMT
This is documented behaviour:
http://httpd.apache.org/docs/current/mod/mod_mime.html#multipleext

PHP is enabled with "addhandler", which means that anything with .php in the extension will be mapped to PHP.
Comment by Pierre Schmitz (Pierre) - Monday, 18 April 2011, 18:11 GMT
I have restricted the file association in the package which is currently in testing (5.3.6-3). I'll move them to extra once I had a chance to test them.

Loading...