0

I am using below Twilio API to send SMS and I have reviewed the code it is working fine on other OS.I have also review the below link for stack Twilio PHP - SSL certificate: self signed certificate in certificate chain unfortunately it is for windows system and i am using ubuntu.

API for sending SMS.

require_once('twilo/Services/Twilio.php');

$number='+91xxxxxxx';
$code='abc';

$sid = "xxxxxxxxxxxxxxxx"; // Your Account SID from www.twilio.com/user/account
$token = "xxxxxxxxxxxxxxxx"; // Your Auth Token from www.twilio.com/user/account

$client = new Services_Twilio($sid, $token);
$message = $client->account->messages->sendMessage(
    '+1 xxx-xxx-xxxx', // From a valid Twilio number
    $number, // Text this number
    $code
);

echo $message->sid;

But when I use this on Ubuntu it gives me the following error:

Uncaught exception 'Services_Twilio_TinyHttpException' with message 'SSL certificate problem: self signed certificate in certificate chain.

Community
  • 1
  • 1
varun joshi
  • 461
  • 1
  • 8
  • 27
  • Possible duplicate of [Twilio PHP - SSL certificate: self signed certificate in certificate chain](http://stackoverflow.com/questions/29153819/twilio-php-ssl-certificate-self-signed-certificate-in-certificate-chain) – Dezza Jun 13 '16 at 12:21
  • Hi the above link is given for windows system and i am using ubuntu so is there any other way to resolve this problem. – varun joshi Jun 13 '16 at 12:32

1 Answers1

0

Twilio developer evangelist here.

This tends to be the case that you are using an outdated version of libcurl. I recommend that you take a look at the FAQ here in the documentation for the Twilio PHP library and follow the steps outlined there.

Let me know if that helps at all.

philnash
  • 70,667
  • 10
  • 60
  • 88