I want to copy image from a url to my server using PHP.
I saw this answer Saving image from PHP URL
and Tried this :
<?php
$url = 'https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xap1/v/t1.0-1/p200x200/548412_147785902099377_260065314_n.jpg?oh=5c97dcd58931398e501666daee4c4ae8&oe=5457AC73&__gda__=1414911437_494ad1af138ee7670f89f4a6ba8b6d06';
$img = 'flower.jpg';
copy($url, $img);
?>
But i got the following error :
failed to open stream: No connection could be made because the target machine actively refused it.
My php version is 5.4 and in my php.ini allow_url_fopen=On
I cant find how to fix this, any clever suggestions?