IIS 7、FastCGI、PHP 和自定义 php.ini 文件

IIS 7、FastCGI、PHP 和自定义 php.ini 文件

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.

此时,我观察到 register_globals 的全局设置 = off(应该如此),但 register_globals 的本地设置 = off,尽管我在站点根目录下创建的 php.ini 文件中进行了不同的指定。

此外,我在 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)      

我搞砸了什么,或者有没有其他方法可以解决这个问题?

答案1

我似乎已经回答了自己的问题。按照这个网站。我必须使用 .user.ini 文件,一切似乎都很好:

相关内容