Kohana 错误:“日志目录不可写”
我在 Kohana 签出了一个项目,我试图让它在本地服务器上运行,但我在这里遇到了问题: http://djaffry.selfip.com:8081/
日志文件夹的权限与其他所有内容相同,
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:37 cache
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:21 config
drwxr-xr-x 4 tipu tipu 4096 2010-06-24 15:23 controllers
drwxr-xr-x 8 tipu tipu 4096 2010-06-24 15:23 css
drwxr-xr-x 5 tipu tipu 4096 2010-06-24 15:24 fckeditor
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:17 helpers
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:35 hooks
drwxr-xr-x 12 tipu tipu 4096 2010-06-24 15:24 images
drwxr-xr-x 7 tipu tipu 4096 2010-06-24 15:24 js
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:17 libraries
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 19:10 logs
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:23 models
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:37 temp_content
drwxr-xr-x 9 tipu tipu 4096 2010-06-24 12:35 upload
drwxr-xr-x 4 tipu tipu 4096 2010-06-24 12:36 vendor
drwxr-xr-x 7 tipu tipu 4096 2010-06-24 15:22 views
知道什么可能是错误的吗?
I have a project I checked out in Kohana and I'm trying to get it running on a local server and I'm getting the issue here: http://djaffry.selfip.com:8081/
The permissions for the logs folder is the same as for everything else,
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:37 cache
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:21 config
drwxr-xr-x 4 tipu tipu 4096 2010-06-24 15:23 controllers
drwxr-xr-x 8 tipu tipu 4096 2010-06-24 15:23 css
drwxr-xr-x 5 tipu tipu 4096 2010-06-24 15:24 fckeditor
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:17 helpers
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:35 hooks
drwxr-xr-x 12 tipu tipu 4096 2010-06-24 15:24 images
drwxr-xr-x 7 tipu tipu 4096 2010-06-24 15:24 js
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:17 libraries
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 19:10 logs
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 15:23 models
drwxr-xr-x 3 tipu tipu 4096 2010-06-24 12:37 temp_content
drwxr-xr-x 9 tipu tipu 4096 2010-06-24 12:35 upload
drwxr-xr-x 4 tipu tipu 4096 2010-06-24 12:36 vendor
drwxr-xr-x 7 tipu tipu 4096 2010-06-24 15:22 views
Any idea what can be wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,日志目录不可写;-)
快速而肮脏的方式(仅限本地机器不生产):
对于生产,将组更改为httpd运行的组,例如
chgrp www -data 日志
并允许其写入(其他则不允许):
chmod 0770 日志
Yes, the log directory isn't writable ;-)
Quick and dirty way (local machine only NOT production):
For production, change the group to that the httpd runs as, e.g.
chgrp www-data logs
and allow it to write (and others not):
chmod 0770 logs
当我阅读该目录行时,日志目录(和其他目录)只能由以用户“tipu”运行的进程写入。如果 Kohana 实例在其他帐户(而非 root 帐户)下运行,则它将被拒绝访问日志目录。如果 Kohana 实例以 root 身份运行,但它表现得足够好,可以在写入之前检查权限,则它可能会拒绝自己访问,因为 root 只被授予读取和执行权限,但没有写入权限。 (不首先检查权限的“不礼貌”写入将会成功,因为 root 根据定义有权在任何地方写入。权限位?我们不需要 STEEENKING 权限位!)
As I read that directory line, the logs directory (and the others) are only writeable by processes running as user "tipu". If the Kohana instance is running under some other account, but not root, it will be denied access to the logs directory. If the Kohana instance is running as root, but it is well-behaved enough to check the permissions before it writes, it may deny itself access, since root is only given read and execute permission, but not write. (An "impolite" write, without checking the permissions first, will succeed, since root by definition has authority to write anywhere. Permission bits? We don't need no STEEENKING permission bits!)
首先,您必须向项目授予 755 权限,为此,请转到目录并运行:
之后,您必须使日志和缓存目录可写:
差不多就是这样。
您可以在此处查看 Kohana 2 的安装文档
干杯,
J
First you have to give 755 permissions to the project, to do that go to the directory and run:
After that you have to make writable the log and cache directories:
That's pretty much it.
You can check the installation doc for Kohana 2 here
Cheers,
J