I have an interesting issue. I installed a PHP application that has image file with strange formats, such as:
thisimagefile.php.gif
The problem is that instead of simply loading this as an image, apache is processing this as PHP.
I used FastCGI handler for PHP, so I imagine there is something in the handler settings in Apache that is causing this. But I am curious to know if anyone has a fix for this so that PHP only load files that ‘end’ in .php, but does not process files that might have .php. somewhere in the filename.
If you rename the files to something without the “.php.” in it, and then browse to that file in your browser, does it seem to work correctly at that point?
In theory, what you’re seeing shouldn’t happen though
There’s a line in Apache like this one which defines what a .php file is:
AddType application/x-httpd-php5 .php
And then a line like this which says what to do with a .php file:
Action application/x-httpd-php5 /cgi-bin/php5.cgi
So, php5.cgi should only be run if the file ends in .php.
If you’re seeing that gif file being executed – that suggests Apache is somehow associating that file as a .php file, not a .gif file.
I lean towards thinking something else is at work
Is there by chance a .htaccess file in that directory that’s causing some confusion?