IIS 7, FastCGI, PHP and custom php.ini files

Posted by Marlon on Server Fault See other posts from Server Fault or by Marlon
Published on 2011-07-21T15:59:06Z Indexed on 2012/10/28 17:04 UTC
Read the original article Hit count: 237

Filed under:
|
|

I'm running PHP 5.3, FastCGI, and IIS 7 on Windows Server 2008. I have a site which I would like to configure its own php.ini settings for but things aren't working as expected. I am following the tutorial located here.

This is what I have done so far:

1) Configured a new website with it's own AppPool.

2) Selected PHP 5.3.6 from the PHP Manager available on the website home on IIS (not the web server home which sets the global version of PHP)

3) Added the following lines to the section of the applicationHost.config file located at system32/inetsrv/config

<application fullPath="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" arguments="-d open_basedir=C:\inetpub\wwwroot\kickasswebsite.com" maxInstances="4" idleTimeout="300" activityTimeout="30" requestTimeout="90" instanceMaxRequests="200" protocol="NamedPipe" queueLength="1000" flushNamedPipe="false" rapidFailsPerMinute="10">
    <environmentVariables>
        <environmentVariable name="PHPRC" value="c:\inetpub\wwwroot\kickasswebsite.com" />
    </environmentVariables>
</application>

4) I then create a php.ini file located in C:\inetpub\wwwroot\kickasswebsite.com (the location of the root of the website)

register_globals = on

5) I then run test.php which simply outputs everything the method call to phpinfo() returns.

At this point, I observe that the global setting for register_globals = off (as it should be), but the local setting for register_globals = off, even though I specified it differently in the php.ini file I created at the root of the site.

Furthermore, I see these settings in the output of the php.ini

Configuration File (php.ini) Path  C:\Windows
Loaded Configuration File  C:\Program Files (x86)\PHP\v5.3\php.ini  
Scan this dir for additional .ini files  (none)
Additional .ini files parsed  (none)      

What am I messing up on, or is there a different way to go about this?

© Server Fault or respective owner

Related posts about windows-server-2008

Related posts about iis7