twilio SMS コードをテストしましたが、いくつか問題があります。ライブラリはhttps://www.twilio.com/docs/php/installにあります。
使用したコードは次のとおりです。
<?php
require "twilio-php/Services/Twilio.php";
// set your AccountSid and AuthToken from www.twilio.com/user/account
$AccountSid = "*******";
$AuthToken = "*********";
$client = new Services_Twilio($AccountSid, $AuthToken);
$message = $client->account->messages->create(array(
"From" => "+14806669029",
"To" => "923331524145",
"Body" => "Test message!",
));
// Display a confirmation message on the screen
echo "Sent message {$message->sid}";
?>
これを実行すると、次のエラーが発生します。
Fatal error: Uncaught exception 'Services_Twilio_TinyHttpException'
with message 'SSL certificate problem: self signed certificate in
certificate chain' in
C:\xampp\htdocs\sms\twilio-php\Services\Twilio\TinyHttp.php:119 Stack
trace: #0 C:\xampp\htdocs\sms\twilio-php\Services\Twilio.php(181):
Services_Twilio_TinyHttp->__call('post', Array) #1
C:\xampp\htdocs\sms\twilio-php\Services\Twilio.php(181):
Services_Twilio_TinyHttp->post('/2010-04-01/Acc...', Array,
'From=%2B1480666...') #2
C:\xampp\htdocs\sms\twilio-php\Services\Twilio\ListResource.php(92):
Base_Services_Twilio->createData('/2010-04-01/Acc...', Array) #3
C:\xampp\htdocs\sms\twilio-php\Services\Twilio\Rest\Messages.php(24):
Services_Twilio_ListResource->_create(Array) #4
C:\xampp\htdocs\sms\send-sms.php(15):
Services_Twilio_Rest_Messages->create(Array) #5 {main} thrown in
C:\xampp\htdocs\sms\twilio-php\Services\Twilio\TinyHttp.php on line
119