Json从URL到curl到PHP

Is it possible I'm doing something wrong with the authentication part since this piece of code returns NULL

$url =  "sample.com/api_sample";
$username = "********";
$password = "********";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_UNRESTRICTED_AUTH, 1);

$result = curl_exec($ch);
$info = curl_getinfo($ch);
var_dump($info);

curl_close($ch);

$data = json_decode( $result, true );

var_dump($data);

This is what my json looks like so i think there is nothing wrong with the url i forward to curl

enter image description here

I have to mention that the page loads for quite some time (5-10 min) until it outputs NULL

EDIT: This is what curl_getinfo($ch) outputs

 array(26) { ["url"]=> string(69) 

"http://luceed.euromdenis.hr:8081/datasnap/rest/partneri/naziv/tomsoft" 
["content_type"]=> NULL ["http_code"]=> int(0) ["header_size"]=> int(0)
["request_size"]=> int(0) ["filetime"]=> int(-1) ["ssl_verify_result"]=> int(0)
["redirect_count"]=> int(0) ["total_time"]=> float(188.461785) 
["namelookup_time"]=> float(0.252828) ["connect_time"]=> float(0) 
["pretransfer_time"]=> float(0) ["size_upload"]=> float(0) ["size_download"]=>
 float(0) ["speed_download"]=> float(0) ["speed_upload"]=> float(0) 
["download_content_length"]=> float(-1) ["upload_content_length"]=> float(-1) 
["starttransfer_time"]=> float(0) ["redirect_time"]=> float(0) ["certinfo"]=> 
array(0) { } ["primary_ip"]=> string(0) "" ["primary_port"]=> int(0) 
["local_ip"]=> string(0) "" ["local_port"]=> int(0) ["redirect_url"]=> string(0) 
"" }

EDIT 2: print curl_error($ch) outputs

Failed to connect to luceed.euromdenis.hr port 8081: Connection timed out