I encountered difficulties when adding PHP Handler Mapping. The handler mappings are stored in%windir%\System32\inetsrv\config\applicationHost.config in system.webServer/handlers section.
Changes to this file can be done manually or using tools such as appcmd.exe or programnatically i.e. with help ofMicrosoft.Web.Administration namespace. I tried both ways using appcmd.exe and c# program but the result was the same, it did not work. The handler mapping was simply ignored when I was loading a page.
However, when I add exactly the same handler using GUI, it all of a sudden works. I did commit the changes when using c# assembly, I did restart the IIS, of course. I also compared the applicationHost.config when adding changes using GUI and appcmd. The file was exactly the same.
What else does GUI do on submitting changes what appcmd doesn't? It's worth noting that after adding the change using GUI, it works even without IIS restart.