有谁知道这个错误意味着什么 的致命: 自动化不再有效.704
当我尝试写入此文件时会发生这种情况,但权限设置为755和0644 临时文件夹位于此子域的根文件夹中。
if ($handle = fopen( 'temp/mylog.log'"a+") )
{
if( !fwrite( $handle, $json ) )
{
throw new Exception("can't write to ...");
}
fclose( $handle );
}
谢谢,理查德
答案 0 :(得分:1)
运行该脚本的用户是否拥有该文件夹/文件?
做一个清单
# ls -l /rootfolder/temp/
要获得有权修改文件的用户,我认为它是 root
在您的shell中执行以下操作以允许您的用户访问该文件(使用您的用户名更改用户)
# 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);