$query = "https://api.facebook.com/method/fql.query?format=JSON&query=";
$urls = array('about 500 link');
foreach ($urls as $url)
{
$query .= urlencode("select post_fbid, fromid, object_id, text, time from comment where object_id in (select comments_fbid from link_stat where url ='$url')");
$query .= "&pretty=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $query);
curl_setopt($ch, CURLOPT_TIMEOUT ,900);
$data = curl_exec($ch);
$response = json_decode($data, true);
echo '<pre>';print_r($response);echo '</pre>';
curl_close($ch);
}
$urls
配列に約 500 個のリンクがあるときにこのコードを実行すると、結果としてエラーがERROR 500 - Internal Server Error
発生し$urls
ます。タイムアウトせずに 500 個すべてのリンクのコンテンツを取得するにはどうすればよいですか?