请耐心阅读,因为问题似乎是透明的,但仅仅是表面上的。情况是这样的:
1.
OS: fedora-16 (latest),
httpd: apache-2.2.21,
php: php-5.3.8 (works as apache's module)DOCUMENT_ROOT: /var/www/[site-name]/public_html
Kohana-3.2.0 (latest stable) installed this way:
$ pwd
/var/www/<site-name>
$ ls -alp
drwxr-xr-x. 6 apache apache 4096 Jan 7 20:35 ./
drwxr-xr-x. 8 apache apache 4096 Jan 7 20:08 ../
drwxr-xr-x. 9 apache apache 4096 Jul 25 03:26 application/
drwxr-xr-x. 10 apache apache 4096 Jul 25 03:26 modules/
drwxr-xr-x. 2 apache apache 4096 Jan 7 20:35 public_html/
drwxr-xr-x. 11 apache apache 4096 Jul 25 03:26 system/
$ cd application/; ls -alp
drwxr-xr-x. 9 apache apache 4096 Jul 25 03:26 ./
drwxr-xr-x. 6 apache apache 4096 Jan 7 20:35 ../
-rwxr-xr-x. 1 apache apache 3612 Jul 25 03:22 bootstrap.php
drwxrwxrwx. 2 apache apache 4096 Jan 8 20:14 cache/
drwxr-xr-x. 4 apache apache 4096 Jul 25 03:26 classes/
drwxr-xr-x. 2 apache apache 4096 Jul 25 03:26 config/
drwxr-xr-x. 2 apache apache 4096 Jul 25 03:26 i18n/
drwxrwxrwx. 2 apache apache 4096 Jul 25 03:26 logs/
drwxr-xr-x. 2 apache apache 4096 Jul 25 03:26 messages/
drwxr-xr-x. 2 apache apache 4096 Jul 25 03:26 views/
Command `top` says that Apache is really starts under `apache` user privileges.那么,如何才能使application/cache和application/logs目录不可写呢?
var_dump(fopen($_SERVER['DOCUMENT_ROOT'] . '/../application/cache/something.txt', 'w+'));同样的结果。不知道这是怎么回事。没有符号链接,没有挂载驱动器等。有人遇到过这样的情况吗?
发布于 2012-01-16 00:04:54
禁用selinux (http://www.crypt.gen.nz/selinux/disable_selinux.html)。
顺便说一句,从安全的角度来看,让apache成为.php文件的所有者是一个非常糟糕的主意
https://stackoverflow.com/questions/8857755
复制相似问题