Showing results for 
Show  only  | Search instead for 
Did you mean: 

unable to connect API "Failed to connect to port 27677: Connection refused"


I am using PHP CURL code for accessing api but unfortunately i got below mentioned ERROR.


Failed to connect to port 27677: Connection refused


My Code:


$url = "";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url );
//curl_setopt($ch, CURLOPT_PORT, $port);
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);

if (curl_errno($ch)) {
print curl_error($ch);

echo $postResult;


For checking purpose i used this code to another hosting panel rather than godaddy it's perfectly working so i think its my hosting issue. Please let me know if there is any setting which i need to update my account for using this API.




Re: unable to connect API "Failed to connect to port 27677: Connection refus

Curl error : Failed to connect to port 4477: Connection refusedbool(false)

I have the same error!   I read other users questions, I think the problem is in port.  

how to send request for open port ?

need help! 

I tested the query on a other hosting - Everything works fine!

PLZ  Robot Very Happy open port 4477 in firewall !!!!!!!!!!!!!



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"userName":"MyName","password":"Pssword"}');
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/json', 'Accept: application/json'));
$out = curl_exec($ch);

   if ($out === false) {
     echo 'Curl error : ' . curl_error($ch);