我有这样的代码,并在本地主机上正常工作,但在服务器上给我的错误:流和file_put_content
警告:stream_get_contents()[function.stream-GET-内容]:流不支持查找在/ home /在线41上的pluspon/public_html/get.php
警告:stream_get_contents()[function.stream-get-contents]:无法在/ home/pluspon/public_html/get.php中找到位置0的流line 41
CODE:
$site = fopen('http://www.google.com', 'r');
$store = 'store.php';
$stream__ = stream_get_contents($site, -1, 0);
file_put_contents($store, $stream__, LOCK_EX);
fclose($site);
$check = file_get_contents($store);
# var_dump($check); print_r($check); var_export($check);
# or simple...
echo $check;
这种错误意味着如何解决这个问题!
在屏幕或apache错误日志上输出这些错误吗?在stream_get_contents($ site,-1)中删除0。在这种情况下没有必要。 – JM4 2011-12-13 20:38:39