我使用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,但它没有帮助
答案 0 :(得分:0)
您的网络应用程序是否在Windows上运行?如果是这样,本文可能会有所帮助:http://www.java-samples.com/showtutorial.php?tutorialid=1050
答案 1 :(得分:0)