【发布时间】:2012-12-20 21:57:55
【问题描述】:
<?php
//Get the file
$content = 'http://dev.aviesta.com.mx/media/catalog/product/cache/1/image/9df78eab33525d08d6e5fb8d27136e95/b/r/bridal-shoes1.jpg ';
//Store in the filesystem.
$fp = fopen('/var/www/ajaxForm/loading.gif', 'w');
fwrite($fp, $content);
fclose($fp);
?>
当我尝试这个时,我得到以下 错误
警告:fopen(/var/www/ajaxForm/loading.gif):未能打开 stream:第 5 行 /var/www/curlimage.php 中没有这样的文件或目录警告:fwrite() 期望参数 1 是资源,布尔值 在第 6 行的 /var/www/curlimage.php 中给出警告:fclose() 期望 参数 1 为资源,在 /var/www/curlimage.php 中给出的布尔值 第 7 行
【问题讨论】:
-
亲爱的我把这个问题放在这里是因为我不明白这个错误
-
Apache 是否拥有创建文件 /var/www/ajaxForm/loading.gif 的良好权限?
-
是的,文件已经创建,apache有读写权限
-
关于 SO 的类似问题:stackoverflow.com/questions/6306935/…
-
@RohitGoel 你看到下面的答案了吗。