benphp Posted February 13, 2012 Share Posted February 13, 2012 I tried changing the MIME type of .HTM to: Extension: .htm MIME-Type: application/x-httpd-php But the htm pages still don't recognize the PHP in the .htm files. I changed the .html MIME too, but still no go. Is there something in PHP.INI I need to switch on? Quote Link to comment Share on other sites More sharing options...
benphp Posted February 13, 2012 Author Share Posted February 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
benphp Posted February 13, 2012 Author Share Posted February 13, 2012 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.