开发者

Kohana Error: `The log directory is not writable`

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?


Yes, the log directory isn't writable ;-)

Quick and dirty way (local machine only NOT production):

chmod o+w logs

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


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!)


First you have to give 755 permissions to the project, to do that go to the directory and run:

 find . -type d -exec chmod 755 {} \;

After that you have to make writable the log and cache directories:

sudo chmod 666 logs/
sudo chmod 666 cache/

That's pretty much it.

You can check the installation doc for Kohana 2 here

Cheers,

J

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜