gpt4 book ai didi

PHP5.3(作为Apache模块)无法写入/var/www///cache

转载 作者:太空宇宙 更新时间:2023-11-04 04:26:04 25 4
gpt4 key购买 nike

请耐心阅读,因为问题似乎很明显,但只是看起来。情况是:

1.

OS:     fedora-16 (latest),
httpd: apache-2.2.21,
php: php-5.3.8 (works as apache's module)

2. 主机信息:

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+'));

相同的结果。不知道怎么会这样。没有符号链接(symbolic link),没有安装的驱动器等。有人遇到过这样的情况吗?

最佳答案

禁用 selinux ( http://www.crypt.gen.nz/selinux/disable_selinux.html )。

顺便说一句,从安全角度来看,让 apache 成为 .php 文件的所有者是一个非常糟糕的主意

关于PHP5.3(作为Apache模块)无法写入/var/www/<project-name>/<document-root>/cache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8857755/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com