iisnode icon indicating copy to clipboard operation
iisnode copied to clipboard

iisnode and PHP running in same site

Open djholly123 opened this issue 12 years ago • 4 comments

It possible to allow .js and .php files to run in same web site on iisnode?

have tried this in web.config app.js works but php does not if I remove the root web.config PHP works as is configured in iis7. Perhaps there is an example config / recommendation

web.config configuration extract:

  <handlers>
       <add name="FastCgiModule2" path="*.php" verb="*.php" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Unspecified" />
       <add name="iisnode" path="app.js" verb="*.js" modules="iisnode" />
 </handlers>
  <rewrite>
       <rules>
            <rule name="LogFile" patternSyntax="ECMAScript" stopProcessing="true">
                 <match url="iisnode" />
            </rule>
            <rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">                    
                <match url="^app.js\/debug[\/]?" />
            </rule>
            <rule name="StaticContent">
                 <action type="Rewrite" url="public{{REQUEST_URI}}" />
            </rule>
            <rule name="DynamicContent">
                 <conditions>
                      <add input="{{REQUEST_FILENAME}}" matchType="IsFile" negate="True" />
                 </conditions>
                 <action type="Rewrite" url="app.js" />
            </rule>
       </rules>
  </rewrite>

djholly123 avatar Oct 16 '14 20:10 djholly123

verb attribute is supposed to be GET, HEAD, POST etc.. like in the following config:

<add name="PHP54_via_FastCGI_Custom" path="*.php" verb="GET,HEAD,POST" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.4\php-cgi.exe" resourceType="Either" />

Also, make sure your applicationHost.config defines fastcgi settings :

<fastCgi> <application fullPath="C:\Program Files (x86)\PHP\v5.4\php-cgi.exe" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000" maxInstances="0"> <environmentVariables> <environmentVariable name="PHPRC" value="path to your php.ini file" /> </environmentVariables> </application> </fastCgi>

rramachand21-zz avatar Oct 16 '14 21:10 rramachand21-zz

The fastcgi -> application-> fullPath attribute should match the handler->scriptProcessor attribute exactly.

rramachand21-zz avatar Oct 16 '14 21:10 rramachand21-zz

thanks for response will give it a try

djholly123 avatar Oct 20 '14 07:10 djholly123

awesome thanks .. I had to disable the URL re-write inherited lines is IIS manager and got it working. image

djholly123 avatar Oct 20 '14 09:10 djholly123