Skip to content Skip to sidebar Skip to footer

How To Get A Php File To Run With An ".html" Extension?

I have to execute PHP codes in a HTML file, but my server not doing it. I added a handler AddHandler application/x-httpd-php .html .htm but still it's not responding to the code. T

Solution 1:

You can try one of the following (probably, add to your .htaccess):

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

Or

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

Solution 2:

Please rename the file from test.html to test.php and browse the file.It will work.

Post a Comment for "How To Get A Php File To Run With An ".html" Extension?"