我期待与PHP函数的fwrite()的一个问题is_writable()返回false
$filename = 'rss.xml';
if (file_exists($filename)) {
echo "The file $filename exists";
}
if (is_writable($filename)) {
$fp = fopen($filename, 'w');
fwrite($fp, $feed);
fclose($fp);
}
else{
echo '<br />not writable..';
if(!is_readable($filename)){
echo ' and not readable!';
}
}
一旦执行该脚本返回:
The file rss.xml exists
not writable..
CHMOD为rss.xml是755和安全模式已关闭。
我在(MT)mediatemple.com上(DV)主办,该脚本工作正常,当我在(GS)解决方案托管。
我找不到什么是错=/
如果删除文件,PHP可以重新创建吗? (当前文件可能由不同的用户拥有,而PHP正在运行。) – 2010-01-23 11:06:53