Twilio - Unable to connect to service

430 views Asked by At

I am using twilio php sdk in my ec2 ubuntu server. When i tried to make a signing key, twilio is giving an exception: "Unable to connect to service".

This is my code

require_once 'path-to-sdk/Services/Twilio.php';
try{
    $sid = "XXXXXXXXXXXXXXXXXXXXXXXX";
    $token = "YYYYYYYYYYYYYYYYYYYYYYYYYY";
    $client = new Services_Twilio($sid, $token);
    $key = $client->account->signing_keys->create(array("FriendlyName" => "test"));

    $signingKeySid =  $key->sid;
    $signingKeySecret = $key->secret;
    echo $signingKeySid." || ".$signingKeySecret;
} catch(Exception $e){
    die("error : ".$e->getMessage());
}



When i traced the error, it comes from Services/Twilio/HttpStream.php;

I tried this same code in my another ec2 ubuntu server. It works fine.

Is this a problem with ssl?

1

There are 1 answers

0
Ijas Ahamed N On

Resolved. Need to install php curl.