試圖在我的應用程序中使用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