FilesMatch in htaccess

rutekp

Verified User
Joined
May 29, 2007
Messages
20
Hi,

From some time i need to use FilesMatch in htaccess to change php version like this:
<FilesMatch "\.php$">
AddHandler x-httpd-php55 .php
</FilesMatch>

I'm sure that couple months ago it wasnt requierd, just AddHandler x-httpd-php55 .php was worked.
Why it is required ?

My httpd-suphp.conf look like this:
<IfModule mod_suphp.c>
<FilesMatch "\.(inc|php|php3|php4|php44|php5|php52|php53|php54|php55|php56|php70|php6|phtml|phps)$">
AddHandler x-httpd-php53 .inc .php .php3 .php4 .php5 .php53 .phtml
AddHandler x-httpd-php55 .php55
AddHandler x-httpd-php56 .php56
</FilesMatch>
<Location />
suPHP_Engine on
#suPHP_ConfigPath /usr/local/php53/lib/
suPHP_AddHandler x-httpd-php53
suPHP_AddHandler x-httpd-php55
suPHP_AddHandler x-httpd-php56
</Location>
</IfModule>

Thanks.
 
Please check official PHP documentation (step #8), it tells why is that needed:
http://www.php.net/manual/en/install.unix.apache2.php

If you decide just to get rid of the <FilesMatch ...> in apache configuration files, that would do the trick with .htaccess AddHandler too, but it would allow exploit.php.jpg to be executed as PHP.
 
Back
Top