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.