简体   繁体   中英

Restricting PHP directory access in IIS7

I searched SO, but only found this for 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.

For example using include (or anything that lists files/directories) won't be able access anything but current and children directories, no parents.

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. This worked, with a caveat, it forced this directive on ALL the websites, which broke all of the other PHP websites on the server.

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:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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