【发布时间】:2011-10-03 19:25:16
【问题描述】:
尝试在我的应用程序中使用 Simple HTML Dom Parser。
将 scraping_slashdot() 的示例函数放入控制器中。
include_once('includes/simple_html_dom.php');
$ret = $this->scraping_slashdot();
print_r($ret);
获取:
ErrorException [ Fatal Error ]: Allowed memory size of 134217728 bytes exhausted (tried to allocate 291337 bytes)
问题是,当我在独立文件(而不是 Ko 应用程序的一部分)中执行完全相同的操作时,一切似乎都运行良好。
有人知道它可能是什么吗?
PS
使用Ko 3.2,没试过其他版本,虽然我之前在3.0用过这个类就好了。
【问题讨论】:
-
您是要抓取一页 slashdot 还是整个 slashdot?一页应该不吸收 128 兆内存附近的任何地方,而整个 slashdot 肯定会。
-
哈哈,只有一页......问题是它作为一个独立的设备运行得很好而且很快,但是当我将它包含在 Kohana 控制器中时,事情就变得混乱了......也许这很糟糕练习一般......?公共函数 action_index() { include_once('includes/simple_html_dom.php');....
标签: php kohana kohana-3 simple-html-dom slashdot