试图在我的应用程序中使用Simple HTML Dom解析器。Kohana和Simple HTML Dom解析器出现问题
将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)
的事情是,当我做同样的事情在一个独立的文件(而不是为KD应用程序的一部分),似乎一切都工作得很好。
有没有人有任何想法它可能是什么?
PS
使用柯3.2,还没有尝试过其他版本,虽然我之前就好使用这个类3.0。
你想抓取slashdot的一个页面,或slashdot的整体?一页应该**不会**吸近128毫米的RAM,而整个slashdot绝对会。 –
哈哈,只是一个页面......问题是,它的工作原理很简单,但是当我将它包含在Kohana Controller中时,事情就会失灵......也许这是一般的糟糕做法.... ?公共职能action_index(){include_once('includes/simple_html_dom.php'); .... – Serhiy