Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want .any file (could be .this or .that etc.) to be treated as a .php file and parse .php code on my windows 2008 server running IIS 7.

How would I go about doing so?

share|improve this question
Though this may not be a concern for you, you are setting yourself up for an astoundingly large security hole. – Zephyr Pellerin Mar 2 '10 at 20:41
@Zephyr Pellerin: how so? What would I have to worry about simply making a .html file parse php code? If I did so on a dedicated server that only I can access? – darkAsPitch Mar 3 '10 at 17:28
LFI and RFI come to mind as problems, if you truly are the only one who has access its not a problem but god forbid it ever goes production. – Zephyr Pellerin Mar 3 '10 at 21:31
up vote 1 down vote accepted

It was a while since I did this, but the process last time was something like this:

  1. Start>control panel>administrative tools>Internet Information Service

  2. Choose the website you want to change (typically the default site) and then open the properties.

  3. Home Directory tab, make sure execute permissions are set to "Scripts and Executables" then go to Configuration

  4. Here you click add, then you add the extension for all request types. Give the path to php.exe.

You might have to restart iis afterwards.

share|improve this answer
Thanks pehrs , but as for number 2 - open properties? Do I right click? I don't see any "properties" value listed anywhere for any site - default or not ? – darkAsPitch Mar 3 '10 at 19:24
Or 3? What do you mean by the home directory tab? I'm using IIS 7. – darkAsPitch Mar 3 '10 at 19:28
Oh, sorry, If you are on IIS 7 it's something like Features View panel, then Handler Mappings see – pehrs Mar 4 '10 at 16:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.