Jump to content

How to set IIS 7 to parse .HTM files as .PHP?


Recommended Posts

Make sure FastCgiModule is installed. You should have configured that during PHP install. If not, there are a lot of how-tos out there for that.

 

[*]In IIS Manager

[*]Navigate to the folder you want to add the rule to.

[*]In the IIS section, double click Handler Mappings.

[*]In Actions, click Add Module Mapping...

[*]Request Path: *.htm

[*]Module: FastCgiModule

[*]Use quotes for the Executable: "C:\Program Files (x86)\PHP\php-cgi.exe"

[*]Name: PhpInHtml

 

Success!

 

BTW, I removed the MIME type. All you need to do is the above.

NOTE: It only worked for me when I applied it to the entire web site (Default Web Site) level. It didn't work by adding Handler Mappings at the folder level. And make sure that your subdirectories are set to inherit from the Parent. In Handler Mappings, you'd need to click "Revert to Parent" if you have custom mappings.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.