First off, let me say; I don't like PHP yet. I like how each website in IIS is completely isolated from one another, regardless of the module being used, without any additional or special configuration steps on my part. But PHP on the other hand, what a pain in my butt.
I have multiple IIS7 webservers setup in a web farm. They each use SharedConfiguration and point to the same applicationHost.config file and point to the same websites on a UNC path. Each website has a copy of its very own php.ini file as well.
\\server\websites\sharedconfig
\\server\websites\web1
\\server\websites\web2
I have PHP version 5.3 non-thread safe installed on each web server in the farm in the same locaiton:
c:\php\
It's very simple, I want to limit (isolate) the users so they can only access files (without exception) to their own folders with their websites in them. In my example above, i don't want any php code in \web1 to be able to access any files or folders in \web2, and vice versa. Based on posts on this site, i have made changes to my applicationHost.config file as such...
<
fastCgi>
<application fullPath="C:\PHP\php-cgi.exe|-d open_basedir=\\server\websites\web1\" activityTimeout="30" requestTimeout="30" instanceMaxRequests="1000" arguments="-d open_basedir=\\server\websites\web1\">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value=\\server\websites\web1\ />
</environmentVariables>
</application>
<application fullPath="C:\PHP\php-cgi.exe|-d open_basedir=\\server\websites\web2\" activityTimeout="30" requestTimeout="30" instanceMaxRequests="1000" arguments="-d open_basedir=\\server\websites\web2\">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value=\\server\websites\web2\ />
</environmentVariables>
</application>
</fastCgi>
The above section in my applicationHost.config file doesnt work at all. It gives me 500 - Internal Server Errors. As soon as I remove the argument info from the fullpath "|-d open_basedir=\\server\websites\webX" values, it works, but they have full control of each other's folders.
Based on the documentation on this site, it also says to do this in the applicaitonHost.config file for each site respectively (where Web1 is obviously replaced by the other site names, like Web2, etc.)
<location path="Web1.com">
<system.webServer>
<handlers accessPolicy="Read, Script">
<add name="PHP_via_FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d open_basedir=\\server\websites\web1\" resourceType="Unspecified" requireAccess="Script" />
</handlers>
</system.webServer>
</location>
And nope, still doesn't work. As soon as I remove the -d option for open_basedir, it stops working. I have no idea what could be wrong. Any help would be greatly appreciated.
On another note, the Administration Configuration module that allows you to use the FastCGI plugin in IIS7 doesn't work in shared configuration mode, so I can't seem to use that to help configure the sites. I have to do everything manually. :-(
Thanks in advance!