Home >
Running PHP Scripts Without The .php Extension
Normally, when you include PHP code on a page, the page must have the .php extension instead of .html. Without the .php extension, the PHP interpreter won't parse the page and the PHP code won't be interpreted.
Here is a trick that will allow you to have PHP code on a page with an .html extension by using an Apache handler. Go to cPanel and select "Apache Handlers" from the Site Management category. Under Extension(s) add .html and under Handler add application/x-httpd-php. Click the Add button and you're done. Now your PHP code should work on a page with an .html extension.
One word of caution: if you have a lot of HTML files on your server, every file will be parsed, and it may slow things down.
![]() |
![]() |


