Server not parsing .html as PHP

Solution 1:

Try:

AddType application/x-httpd-php .html .htm

UPDATE 1

It may be PHP version specific. If you're using PHP5 try:

AddType application/x-httpd-php5 .html .htm

UPDATE 2

Try:

RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Or here's yet another alternative way to do this:

<FilesMatch "\.html$">
    ForceType application/x-httpd-php
</FilesMatch>

Solution 2:

On Apache 2.2.22 (Ubuntu) with Php 5 add these lines to /etc/apache2/mods-enabled/php5.conf

<FilesMatch ".+\.html$">
    SetHandler application/x-httpd-php
</FilesMatch>

and restart apache

sudo service apache2 restart

Solution 3:

For godaddy shared hosting (php-cgi):

From http://sagarnangare.com/parse-html-as-php-using-htaccess-file-on-godaddy/

AddHandler fcgid-script .html
FCGIWrapper /usr/local/cpanel/cgi-sys/php5 .html

That's the only one that worked for me.

Solution 4:

If you are using Plesk Control Panel:

PHP is running as an Apache module:

<IfModule mod_php5.c>
   AddHandler php5-script .php .html .htm
   AddType text/html .php .html .htm
</IfModule>

PHP is running as a FastCGI application:

<IfModule mod_fcgid.c>
    <Files ~ (\.html)>
        SetHandler fcgid-script
        FCGIWrapper /var/www/cgi-bin/cgi_wrapper/cgi_wrapper .html
        Options +ExecCGI
        allow from all
    </Files>
</IfModule>

PHP is running as a CGI application:

<Files ~ (\.html)>
    SetHandler None
    AddHandler php-script .html
    Options +ExecCGI
    allow from all
</Files>

Then /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

http://kb.odin.com/en/115773