[ 已解决 ] PHP 写入文件 权限 错误
发表于 : 2010-09-15 18:08
下面的写入文件时,出现权限错误
public_html的权限:
public_html文件夹下面的php文件权限:
文件 text2.txt 新建的/已存在的都试过的,问题一样!
google 了只找到一些关于 apache 进程运行用户的一些提示
我的 apache 是使用 sudo 启动的,普通用户下面 pstree 可以看到 httpd 的进程
用户所在组:
希望各位兄台给些帮助,非常感谢!!!
代码: 全选
$wline=fopen("./test2.txt","a+t");
$line="它-024";
fwrite($wline,$line);
fclose($wline);
代码: 全选
fopen(./test2.txt): failed to open stream: Permission denied
代码: 全选
drwxr-xr-x 41 king users 4.0K 2010-09-15 public_html/
代码: 全选
-rwxr-xr-x 1 king users 268 2010-07-18 test.php
google 了只找到一些关于 apache 进程运行用户的一些提示
我的 apache 是使用 sudo 启动的,普通用户下面 pstree 可以看到 httpd 的进程
代码: 全选
├─httpd───7*[httpd]
代码: 全选
~ · groups
lp wheel log dbus hal network video audio optical floppy storage users