How to get PHP to run inside HTML files on IIS

Yes, I know - I HAD to use IIS for this job, and as you are probably also aware .htaccess files do not work outside of Apache - so how to rename my .php files to .html and still get the code to run? Used to be that you had to set up a ISAPI filter to do this, but if you've updated IIS and / or PHP recently you'll realise that you are pretty much required to use FastCGI (the latest PHP installer gives you the option to not use FastCGI, but breaks everything horribly to punish you). SO once you've upgraded IIS to FastCGI and installed the latest PHP you need to do the following:
- Go into that dreadful IIS manager thing
- Right click your web-site and go into the Home Directory page on the properties
- Hit the Configuration... button and under mappings edit / create an entry for .html
- "Executable" should point to c:\windows\system32\inetsrv\fcgiext.dll
- All verbs (unless you're especially wanting to lock it down)
- tick Script Engine and Verify that file exists
- Open c:\windows\system32\inetsrv\fcgiext.ini in a text editor
- Under the [Types] section add the line:
html=PHP

Should work immediately. Bonza!

Comments

Popular posts from this blog

Installing LAMP Apache/MySQL/PHP on Chromebook/Chromebox

Installing Ubuntu Linux on your ChromeBox/ChromeBook

Changing your Mac OSX Terminal's default text editor