How to map the PHP extension to ASP.NET 2.0 isapi-filter
I was trying to have webpages with the .PHP extension be processed by IIS 6 and ASP.NET 2.0. Here is the error that I was getting, "There is no build provider registered for the extension ‘.php’. You can register one in the <compilation><buildProviders> section in machine.config or web.config. Make sure is has a BuildProviderAppliesToAttribute attribute which includes the value ‘Web’ or ‘All’. After some research, I found a few settings to make this work. I wanted to pass along my findings because when searching on Google, there was only 2 results. This article covers the basic syntax. http://arje.net/
#1
Add the PHP script mapping in IIS and point it to the ASP.NET 2.0 ISAPI-filter.
#2 and #3
After you add the script mapping to IIS 6. There are a couple of items to
add to the web.config. You have to add the HTTP Handler and
buildProviders option listed below.
<?xml version="1.0"?>
<configuration>
<system.web>
<httpHandlers>
<add verb="*" path="*.php" type="System.Web.UI.PageHandlerFactory"
validate="True" />
</httpHandlers>
<compilation debug="false"
batch="true" batchTimeout="120">
<buildProviders>
<add extension=".php" type="System.Web.Compilation.PageBuildProvider" />
</buildProviders>
</compilation>
</system.web>
</configuration>
If you don’t have these don’t have these settings you’ll receive this error.
An unhandled exception was generated during the execution of
the current web request. Information regarding the origin and location
of the exception can be identified using the exception stack trace
below.
|
|