Fopen代码可以在Windows上运行,但不能在ubuntu上运行


fopen code working on windows but not on ubundu

我有以下php代码,在windows上正常工作,但在Ubuntu 12.04中不正常,

<?php
$date="hi";
$filename="files/".$date.".txt";
echo $filename;
$fop=fopen($filename,"a");
echo $fop;
fclose($fop);
?>

请帮我解决这个问题。由于

使用chmod检查文件权限

if( chmod("yourFileName", 0775) ){
    // your code here
}

,在linux中这个文件是绝对的,例如:

/var/www/html/folder/file.txt
相关文章: