简体   繁体   English

如何拒绝对Apache / PHP的整个计算机文件系统的访问?

[英]How to deny access to whole computer file system for Apache/PHP?

My Apache/PHP web server located in "F:\\WebServer", but it has access to whole computer file system (not only "F:* WebServer* ", but system drive and disk "F:\\" too): 我的Apache / PHP Web服务器位于“ F:\\ WebServer”中,但是可以访问整个计算机文件系统(不仅是“ F:* WebServer * ”,而且还可以访问系统驱动器和磁盘“ F:\\”):

在此处输入图片说明

How to restrict Apache/PHP access it? 如何限制Apache / PHP访问? I want only access "F:* WebServer* " folder and files/folders inside it 我只想访问其中的“ F:* WebServer * ”文件夹和文件/文件夹

The most common way to do this is to limit the permission of your apache user but I'm not quite sure how to go about this with Windows permissions. 最常见的方法是限制您的apache用户的权限,但是我不太确定如何使用Windows权限来实现此目的。

However, The PHP ini includes a directive to restrict the folders PHP will traverse to:- 但是,PHP ini包含一个指令,用于限制PHP将遍历的文件夹:-

open_basedir string open_basedir 字符串

Limit the files that can be accessed by PHP to the specified directory-tree, including the file itself. 将PHP可以访问的文件限制为指定的目录树,包括文件本身。 This directive is NOT affected by whether Safe Mode is turned On or Off. 此指令不受打开或关闭安全模式的影响。

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

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