文件...无法打开流:权限被拒绝 [英] file ... failed to open stream: Permission denied
问题描述
我正在为一个客户端处理一个站点,我已经在服务器上克隆了整个站点,并且似乎可以正常工作. 现在,我已将网站复制到他的服务器上,并尝试付款(使用paypal pro),但出现权限错误:
I am coping a site for a client, I've clones the whole site on my server and it seem to work. now that I've copied the site over to his server and trying to make a payment (using paypal pro) i get a permission error:
`Warning: error_log(../PayPal.log) [function.error-log]: failed to open stream: Permission denied`
我尝试将所有权限都更改为777,并且此错误不断出现.
I've tried changing the permissions to 777 for everything and this error keep coming.
我已经四处看看,在google中,在这里我看到它可能与php设置(safemode
或open_basedir
)有关,但是当我检查phpinfo()
时,似乎safemod被禁用并且open_basedir是空的.
I've have looked around, in google and in here i saw that it might have something to do with php settings (safemode
or open_basedir
) but when i check phpinfo()
its seems safemod is disabled and open_basedir is empty.
有想法的人吗?
推荐答案
更新
在添加任何虚拟主机(甚至单个主机)时,必须在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.
这篇关于文件...无法打开流:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!