log4php无法在linux环境下创建文件
我在运行 Windows 7 和网络的工作台式机上使用 log4php 创建了一个小型 php 应用程序。 它工作正常,每日文件已创建并登录。
现在我在我的笔记本电脑上运行 ubuntu 11,04。我最初将权限 755 授予文件夹 Integrator
(应用程序的名称)和 /var/www/Ingrator
下的子文件夹。意识到这一点后
2011 年 5 月 16 日星期一 18:03:44] [错误] [客户端 127.0.0.1] PHP 警告:fopen(./logs/daily_20110516.log):无法打开流:/var/www/Integrator 中的权限被拒绝/lib/log4php/appenders/LoggerAppenderFile.php 第 77 行
apache 日志中第 77 行权限问题上,我已将所有者更改为当前所有者,但是这个。它给出了相同的错误。现在它甚至具有权限 777。它仍然是持久的。 所以我有点惊讶。我该如何解决这个问题?感谢您阅读本文。
I've create a small php application with log4php on my work desktop machine running windows 7 and net.
it works fine, daily file it's been created and log are in.
NOw i'm on my laptop running ubuntu 11,04. i originally gave persmission 755 to the folder Integrator
(name of the app) and subfolder under /var/www/Ingrator
.after realizing this
Mon May 16 18:03:44 2011] [error] [client 127.0.0.1] PHP Warning: fopen(./logs/daily_20110516.log): failed to open stream: Permission denied in /var/www/Integrator/lib/log4php/appenders/LoggerAppenderFile.php on line 77
permission issue in the apache log, i've changed the owner to be the current owner, but this. it gives the same error.now it's even with the permission 777. it's still persistent.
So i'm a little surprise.how can i fix that? thanks for reading this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该错误表明它正在尝试打开该文件,这意味着 Apache 用户没有访问该文件的权限。基本上,它可以打开文件夹并查看文件在那里,但无法对其执行任何操作,因为文件夹的权限与文件的权限是分开的。
确保该文件属于 www-data 组中的 www-data,或者具有 www-data 可以使用的读/写权限(假设您将 Apache 用户保留为 www-data,如果没有,请使用您的 Apache 用户)已定)。
The error says it's trying to open the file, which means that the Apache user doesn't have permission to the file. Basically, it can open the folder and see that the file is there, but can't do anything with it, because permissions for folders are separate from permissions for files.
Make sure the file is owned by www-data, in the www-data group, or has read/write permissions that www-data can use (assuming you left the Apache user as www-data, if not, use the Apache user you've set).