Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的服务器上有目录/www/site1和目录/www/site2。我想阻止文件site1执行以下操作:
/www/site1
/www/site2
site1
include("../site2/configuration.php");
我需要目录完全独立。
以 Web 服务器用户以外的用户身份运行 PHP ,并设置目录和文件的权限,以便它们只能由所有者 ( chmod 700) 访问。
chmod 700
您可以使用open_basedir php.ini 指令。