我在windows下能创建txt 在linux下就执行不了写入那句了 为什么 如何得到正确的目录位置呢
<?php
$path ="http://192.168.10.99";
$dir ="./";
$file=time().".txt";
$content=$_POST["text"]; $filepath=$path."/".$file;
$fpath=$dir.$file; $txt=fopen($fpath,'w');
if($txt)
{
fwrite($txt,$content);
}
else
{
echo "error";
} fclose($txt);
echo $filepath;
?>
<?php
$path ="http://192.168.10.99";
$dir ="./";
$file=time().".txt";
$content=$_POST["text"]; $filepath=$path."/".$file;
$fpath=$dir.$file; $txt=fopen($fpath,'w');
if($txt)
{
fwrite($txt,$content);
}
else
{
echo "error";
} fclose($txt);
echo $filepath;
?>
error
Warning: fclose(): supplied argument is not a valid stream resource in /www/webroot/do.php on line 25
chmod -R 0777 /www正常做法:
chmod -R 0775 /www
chown -R [apache的启动user] /www