php 7 - Weird cURL behaviour in PHP -


i facing weird situation using sftp protocol in curl. if try download file using option:

curl_setopt($this->curl, curlopt_port, $port); 

the curl_exec function call hang until connection times out, if file try download empty (0 bytes), other files works fine. if remove curlopt_port function call , instead set port in url so:

$remote_address = "sftp://$username:$password@$hostname:$port/"; 

it downloads files, including empty ones. there i'm missing here?


Comments