View Full Version : can't execute php-script inside .htm files

09-03-2003, 03:09 AM
On several sites I use php-script inside .htm files.

This was possible because the following line is inside .httaccess file:
AddType application/x-httpd-php .htm .html .php .php3

Now my .htm files are not parsed/shown at all and my browser suggests to download the file...

I have two questions:

1. How do I get my .htm files to work normal / at all?
2. How can I get php-script to work in .htm files again?

As you may have guessed, my sites are down, so any help would be appriciated!

Thank you!

09-04-2003, 04:26 AM
Problem solved!

From a user comment in the PHP manual:

Finally figured this out: if you are using server side includes (SSI) with Apache, and have added a line

AddHandler server-parsed .html .htm

in your httpd.conf file so that .html/.htm files can use SSI, this setting will prevent

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

from working (.php will work, but .html/.htm won't). From what I've figured out so far, you need to dump SSI support for .html/.htm files if you want to get PHP to work with .html/.htm files.

Westhost has configured Apache to parse .html/.htm files for SSI.
Removing these extentions from the apache config file solved the problem