文件存在,但我无法使用PHP打开它

时间:2015-10-22 04:35:08

标签: php linux apache file

我可以使用vim命令在文件中打开和写入,但我无法使用PHP

打开它
$myFile = "v.txt"; 
if(!file_exists($myFile)){
    print 'File not found';
}else if(!$fh = fopen($myFile, 'w+')){
    print 'Can\'t open file \n';}.
else{  
    print 'Success open file';
}

1 个答案:

答案 0 :(得分:0)

做一个

ls -l

在包含该文件的目录上。确保运行Web服务器的用户具有对文件的读取权限