2016-06-13 50 views
0

我使用下面Twilio API发送短信,我已审阅代码 它正在其他OS.I罚款也查看以下链接栈 Twilio PHP - SSL certificate: self signed certificate in certificate chain不幸的是 Windows系统和我使用Ubuntu的。如何在Ubuntu解决SSL证书错误

用于发送SMS的API。

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; 

但是当我使用这个在Ubuntu它给了我下面的错误:

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

+0

[Twilio PHP - SSL证书:证书链中的自签名证书]的可能副本(http://stackoverflow.com/questions/29153819/twilio-php-ssl-certificate-self-signed-certificate-in-certificate链) – Dezza

+0

嗨上面的链接是给出的Windows系统,我使用Ubuntu的,所以有没有其他办法来解决这个问题。 –

回答

0

Twilio开发者传道这里。

这往往是您使用过时版本的libcurl的情况。我建议你看看FAQ here in the documentation for the Twilio PHP library并按照这里列出的步骤进行操作。

让我知道这是否有帮助。

+0

嗨philnash我回顾了上面,但它不能解决我的问题。 –

+0

你是说你的服务器上有最新版本的libcurl吗? – philnash