I just used file_get_contents to retrieve data on my site. But returns nothing.
file_get_contents("https://www.google.co.in/images/srpr/logo11w.png")
When I used the same in my local environment, it returns a value.
I also tried curl on my website to find out if it returns anything. But he shows
Forbidden
You do not have access to access.
I googled and I found some tips. I have enabled allow_url_fopen and allow_url_include .
But nothing works.
Curl code i tried
function curl($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); $return = curl_exec($ch); curl_close ($ch); return $return; } $string = curl('https://www.google.co.in/images/srpr/logo11w.png'); echo $string;
php curl file-get-contents phpinfo
vinothavn
source share