且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

文件...无法打开流:权限被拒绝

更新时间:2022-12-17 16:53:43

更新

在添加任何虚拟主机(甚至单个主机)时,必须在Apache中设置DocumentRoot. 该指令告诉apache在哪里查找文件并映射网站的根.

While adding any virtual host (or even single host) you must set a DocumentRoot within Apache. That directive tells apache where to look for the files and map the root of the website.

DocumentRoot "/var/www/vhosts/www.example.com"

但是,仅该指令不会授予客户端读取/写入该目录的权限.您必须指定该目录的配置,例如.

But that directive alone doesn't give access to client to read/write that directory. You must specify the configuration for that directory, like.

<Directory "/var/www/vhosts/www.example.com">
      Options Indexes FollowSymLinks
      AllowOverride All
      Order allow,deny
      Allow from all 
</Directory>

如果您的文档根目录(在此示例中)为/var/www/vhosts/www.example.com,则apache需要具有对/var/www/vhosts/和/var/www/vhosts/的写入/执行访问权限需要在apache中配置.

if your Document root (within this example) is /var/www/vhosts/www.example.com apache would need to have write/execute access to /var/www/vhosts/ and /var/www/vhosts/ would need to be configured within apache.

好的.

我相信,如果一切都为777,则问题很可能与open_basedir或/和Apache指令有关.

I believe that if everything is 777 the problem is most likely related to open_basedir or/and directive for apache.

确保.apache和open_basedir中可访问../Paypal.log. 还请记住该../范围内还有什么,以及它将如何影响您的安全性.

Make sure that ../Paypal.log is accessible within apache and open_basedir. Also bear in mind what else is within that ../ scope and how it will impact your security.