关于fopen()函数不能创建文件问题
发表于 : 2015-12-26 0:05
php代码如下:
<?php
if (file_exists("fileReadOnly.txt"))
{
$fh=fopen("fileReadOnly.txt", "w");
}
else
{
die("!!!!The file does not exit.");
}
?>
1.php文件权限: -rwxrwxrwx 1 root root 142 12月 25 23:47 1.php 。 文件路径:yuesha@yuesha:/var/www/html/phptest$ (其中phptest文件夹只有1.php一个文件)
我把所有的文件权限全部改为777
drwxrwxrwx 2 root root 4096 12月 25 23:57 phptest
drwxrwxrwx 6 root root 4096 11月 30 14:51 html
drwxrwxrwx 3 root root 4096 11月 15 23:56 www
drwxrwxrwx 14 root root 4096 11月 14 18:36 var
在浏览器运行文件,输出的结果是:!!!!The file does not exit. 证明文件还什能够运行,可是我回到phptest文件夹里面查看,没有发现fileReadOnly.txt文件创建。
请问这是什么原因,该如何解决?
<?php
if (file_exists("fileReadOnly.txt"))
{
$fh=fopen("fileReadOnly.txt", "w");
}
else
{
die("!!!!The file does not exit.");
}
?>
1.php文件权限: -rwxrwxrwx 1 root root 142 12月 25 23:47 1.php 。 文件路径:yuesha@yuesha:/var/www/html/phptest$ (其中phptest文件夹只有1.php一个文件)
我把所有的文件权限全部改为777
drwxrwxrwx 2 root root 4096 12月 25 23:57 phptest
drwxrwxrwx 6 root root 4096 11月 30 14:51 html
drwxrwxrwx 3 root root 4096 11月 15 23:56 www
drwxrwxrwx 14 root root 4096 11月 14 18:36 var
在浏览器运行文件,输出的结果是:!!!!The file does not exit. 证明文件还什能够运行,可是我回到phptest文件夹里面查看,没有发现fileReadOnly.txt文件创建。
请问这是什么原因,该如何解决?