set fastCgi with appcmd
The official FastCgi section says:
You can configure the <fastCgi> element at the server level in the ApplicationHost.config file or at the site level, at the application level, or at the directory level in a Web.config file.
However this is not by default, since applicationHost.config has pre-defined:
<sectionGroup name="system.webServer"> ... <section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Deny" /> ... </sectionGroup>
Thereby if type this command:
appcmd set config mainsite /section:fastCgi /+"[fullPath='d:\php\php-cgi.exe',arguments='-d open_basedir="d:\mainsite"']"
It just throw such error:
ERROR ( message:New application object missing required attributes. This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".. )
NOTE: the parameter should be quoted if contains any space!! That means , you can't even type as :
C:\Windows\System32\inetsrv>appcmd set config mainsite /section:fastCgi /+[fullPath='d:\php\php-cgi.exe', activityTimeout='500']
beause a space is padded in between "..-cgi.exe'," and "activityTimeout". Typing as this causes such error:
Failed to process input: The parameter 'activityTimeout='500']' must begin with a / or - (HRESULT=80070057).
Nonsense.