I am sorry, i never updated this question completely. May be if some one is still looking for an answer.
This has worked for me. This is the equivalent function for File_get_contents, but can handle large amount of data. I found this solution online.
function file_get_contents_curl($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}