Parse .html files for php
SUHOSIN and SUPHP
If you are using shared hosting on a Linux server, the usual method for parsing .html files for included php code is to add the following line to the .htaccess file:
AddType application/x-httpd-php .html
However, lately many hosting companies have utilized SUPHP or SUHOSIN to add security to php on their servers. That is nice, but doing so suddenly causes the above solution to fail. If suddenly your .html files no longer parse correctly for php, and your browser starts asking you for an application to open the web site page, then this may be your problem.
I have encountered this and tried adding Apache handlers to my web sites via Cpanel, but never got things to work doing this. I did a lot of Googleing without finding an answer that worked.
Without going into any discussion of how and why things work, or worse still whether or not you should parse .html files for php in the first place, there is a solution. Replace the above .htaccess line with the following:
<FilesMatch .html>
SetHandler application/x-httpd-php5
</FilesMatch>
This has worked for me on servers using both SUPHP and SUHOSIN, and the php code in my .html pages is parsed successfully.
Of course, once you have the solution, searching by the solution term makes it easy. An example with more explanation and detail is here.