When PHP is installed in Apache files with the .php extension are interpreted as PHP scripts. It is possible to make any file extension be parsed as PHP including .html.
Make a .html file be parsed as PHP
This can be done at the following levels:
- The main Apache configuration which will apply to all virtualhosts
- An individual <virtualhost>
- In an .htaccess file
It can either be done for everything, or using e.g. a <Directory> block to limit it to a specific directory. With an .htaccess file it will apply to the directory the .htaccess file is in and all subdirectories below that one.
Simply add the following line to the appropriate location as noted above:
AddType application/x-httpd-php .html
Now all files with a .html extension will be parsed as PHP.
A note of warning: it is not generally a good idea to make all .html files be parsed as PHP. If they do not contain any PHP code then they will still invoke the PHP interpreter which will cause additional overhead on the web server. Make sure you have good reason to do so, and ideally limit it to an individual virtualhost and then possibly to particular directories.