Solution :
I had faced this issue in the past. I had also done a lot of research and found solution on it. So to fix my issue I wrote below function and it fixed my issue. You can also use below function to fix your issue.
<?php
$phpurl = "http://www.example.org/";
$phpch = curl_init();
curl_setopt ($phpch, CURLOPT_URL, $phpurl);
curl_setopt ($phpch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt ($phpch, CURLOPT_RETURNTRANSFER, true);
$phpcontents = curl_exec($phpch);
if (curl_errno($phpch)) {
echo curl_error($phpch);
echo "\n<br />";
$phpcontents = '';
} else {
curl_close($phpch);
}
if (!is_string($phpcontents) || !strlen($phpcontents)) {
echo "Failed to get the required phpcontents.";
$phpcontents = '';
}
echo $phpcontents;
?>
Also you need to edit your php.ini and you need to find allow_url_fopen in it and set it to allow_url_fopen = 1
Hope above solution helps.