skip to Main Content

problem

  Curl error: Failed to connect to 103.16.101.52 port 8080: Connection refusedresource(4) of type (mysql result)
  • code snippets works in localsystem.

  • it’s not working prod enviornment.

php curl snippet

try {

    $runfile = 'http://103.16.101.52:8080/sendsms/bulksms?username=XXX&password=XXX&type=0&dlr=1&destination='. $row['phone_number'] . '&source=XXX&message='.$message;

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL, $runfile);

    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

    $content = curl_exec ($ch);



    if(curl_exec($ch) === false)
    {
        echo 'Curl error: ' . curl_error($ch);
    }
    else
    {
        echo 'Operation completed without any errors';
    }
    var_dump($result);die;
    curl_close ($ch); 

    } 
    catch (Exception $e) {

    $message = $e->getMessage();
    print_r($message);
    die;
    }
  • i googled and found

       CURLE_NOT_BUILT_IN (4)
    
       A requested feature, protocol or option was not found built-in in 
      this libcurl due to a build-time decision. This means that a feature 
       or option was not enabled or explicitly disabled when libcurl was 
       built and in order to get it to function you have to get a rebuilt libcurl.
    
  • does this error belongs ipv4 or ipv6.

  • im using cpanel please suggest.

Solution that worked for me

i tried with 80 port

  $runfile = 'http://103.16.101.52:80

2

Answers


  1. Just to put this as a proper answer…
    Use port 80, 8080 is usually used when you have something else running that also uses 80. (I use containers and 8080 is directed to my phpmyadmin container, 80 to my Apache container)

    Login or Signup to reply.
  2. Do a telnet 103.16.101.52 8080. If you get connected them it could be a curl/php issue. If you get a connection refused message then the server is not listening on that port on the specified ip address. The way it looks from your message, you can’t connect on that port because nothing listens on that port on your server (at least at the moment you have asked the question here).

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search