You have to change/implement the Apache File Handling options and this can be done through two ways:
First Way
- Step 1: Login to your CPanel by typing www.yourdomain.com/cpanel into your address field in your browser. Type in your login information.
- Step 2: Click on the Apache Handlers icon or link option.
- Step 3: Enter in the file extension you want to add like .html into the small field and application/x-httpd-php in the larger field for the PHP program. Then click the Add button. If you want to delete one, select it from the drop-down menu and click the Delete button. The other programs that you might want to have it run thought are below:
application/x-httpd-cgi - for CGI
application/x-httpd-asp - for ASP (Active Server Pages)
application/x-httpd-asp-cgi - for ASP in CGI scripts
application/x-tar - for .tgz compressed files
application/zip - for .zip compressed files
Second Way
.htaccess Method
On a new line paste in the following.
AddHandler application/x-httpd-php .html
AddHandler application/x-httpd-php .htm
Save the file and then upload it back to your site root directory. That’s it. Your files that end in .html or .htm will now be processed by PHP so you can put PHP code in them.