【发布时间】:2012-09-15 15:54:25
【问题描述】:
我使用curl从页面获取数据
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $page);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10);
$str = curl_exec($curl);
curl_close($curl);
$raw= str_get_html($str);
$page 是页面的网址
效果很好,但是当我尝试从大于正常的页面获取数据时,我的 apache 停止响应
这是 apache 日志:
[Sat Sep 15 10:17:36 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.9 configured -- resuming normal operations
[Sat Sep 15 10:17:36 2012] [notice] Server built: Sep 10 2011 11:34:11
[Sat Sep 15 10:17:36 2012] [notice] Parent: Created child process 3908
[Sat Sep 15 10:17:36 2012] [notice] Child 3908: Child process is running
[Sat Sep 15 10:17:36 2012] [notice] Child 3908: Acquired the start mutex.
[Sat Sep 15 10:17:36 2012] [notice] Child 3908: Starting 64 worker threads.
[Sat Sep 15 10:17:36 2012] [notice] Child 3908: Starting thread to listen on port 8080.
[Sat Sep 15 10:17:53 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting.
我认为页面大小是个问题(不确定),有人可以确认吗?有没有办法解决这个问题?我试图增加 php.ini 中的 memory_alocation 但它没有帮助
【问题讨论】:
-
和“比正常大”是指更可测量单位的尺寸?
-
你知道你正在加载的内容的大小吗?
-
另外,没有
memory_alocation配置项。你的意思是memory_limit? -
当我说大于正常时,我的意思是带有女巫的更大页面,它可以正常工作。当我保存页面时,它是 231 KB 的 htm 文件。是的,我指的是 memory_limit