【发布时间】:2013-05-12 20:39:27
【问题描述】:
我基本上想做这样的事情:Simple Html DOM Caching
到目前为止,我已经完成了所有工作,但现在我收到了以下错误,因为我抓取了许多网站(目前为 6 个,我最多需要 25 个网站):
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 39 bytes)
我是一个 php 新手 =/...所以,我怎样才能逐步“序列化”我的记忆不放弃的抓取过程? :-)
代码示例:
// Include the library
include('simple_html_dom.php');
// retrieve and find contents
$html0 = file_get_html('http://www.site.com/');
foreach($html0->find('#id') as $aktuelle_spiele);
file_put_contents("cache/cache0.html",$aktuelle_spiele);
非常感谢您的帮助!
【问题讨论】:
-
提高内存限制....看来您只有 32 mb 的内存限制
标签: php html performance dom