我有一个页面调用的index.php这是在调用一个函数“WRITELOG”包括/ Logger.phpPHP写文件错误
我已经文件位于包含文件夹,代码如下所示。
function writelog($logText){
$myFile = "testlog.txt";
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $logText + "\n";
fwrite($fh, $stringData);
fclose($fh);
}
它显示errror“无法打开文件”。我为每个人设置了FullPermission,但它仍然无法访问文件。我试图将文件放在与index.php相同的文件夹中,并且出现同样的错误。可能的原因是什么?我错了路吗?