简体   繁体   English

限制IIS7中的PHP目录访问

[英]Restricting PHP directory access in IIS7

I searched SO, but only found this for Apache. 我搜索了SO,但只为Apache发现了这个。

In IIS7 for ONE specific website, how do I restrict PHP 5.3.8 (FASTCGI) so it can only access files within that website's directory. 在IIS7 for ONE特定网站中,如何限制PHP 5.3.8(FASTCGI),以便它只能访问该网站目录中的文件。

For example using include (or anything that lists files/directories) won't be able access anything but current and children directories, no parents. 例如,使用include(或列出文件/目录的任何内容)将无法访问除当前和子目录之外的任何内容,不能访问任何父项。

What I have tried: In IIS7 after clicking the website in the left panel, then in the right panel clicking PHP Manager, I added open_basedir directive with the path. 我尝试过:在IIS7中单击左侧面板中的网站后,在右侧面板中单击PHP Manager,我添加了带路径的open_basedir指令。 This worked, with a caveat, it forced this directive on ALL the websites, which broke all of the other PHP websites on the server. 这有点需要注意,它在所有网站上强制执行此指令,这打破了服务器上的所有其他PHP网站。

thanks ahead of time. 提前谢谢。

If someone in IIS7 has this issue, I was able to solve this by opening the php.ini and adding below: 如果IIS7中有人遇到此问题,我可以通过打开php.ini并在下面添加来解决此问题:

[PATH=C:/inetpub/website1.com/www/]
open_basedir=/www/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM