0

有谁知道这个错误意味着什么 致命:Autorisation 不再有效.704

当我尝试写入此文件时会发生这种情况,但权限设置为 755 和 0644 临时文件夹位于此子域的根文件夹中。

if ($handle = fopen( 'temp/mylog.log'"a+") )
                {
    if( !fwrite( $handle, $json ) )
    {
    throw new Exception("can't write to ...");
    }
    fclose( $handle );
    }

谢谢,理查德

4

1 回答 1

1

运行该脚本的用户是否拥有该文件夹/文件?

做一个清单

# ls -l /rootfolder/temp/

获取有权修改文件的用户,我想它是root

从您的外壳执行以下操作以允许您的用户访问文件(使用您的用户名更改用户

# chown user /rootfolder/temp/mylog.log

也使用 fopen 中的完整路径。

更新:
使用这个简单的步骤来写入文件,如果你得到错误,那么它可能与权限有关

$myFile = "/home/woonbel/public_html/tsa.nl/temp/tsa.log";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = "Some of your text...bla bla\n";
fwrite($fh, $stringData);
fclose($fh);
于 2010-01-21T14:20:42.467 回答