【发布时间】:2011-06-01 08:59:00
【问题描述】:
我遇到以下情况:
public_html - 755
=> 头像 - 777
=> 民意调查 - 755
现在,当我使用以下代码时,我会收到一个错误(警告:file_put_contents(../test.php) [function.file-put-contents]: failed to open stream: Permission denied in XXX):
<?php
file_put_contents('../test.php','<?php');
?>
但是当我使用下面的代码时,它会工作得很好:
<?php
file_put_contents('test.php','<?php');
?>
(均从 'avatar' 执行,使用 0777)
我该如何解决这个问题?
【问题讨论】:
-
“都从‘头像’执行”?你对此有多大把握?
-
是的,“execute.php”在头像文件夹中,权限为0777,而public_html的权限为0755
标签: php file-get-contents chmod open-basedir