我正在遵循Twilio Voice API中的PHP快速入门教程。 我正在使用php 5.6和xampp。
<?php
require __DIR__ . '/vendor/autoload.php';
use Twilio\Rest\Client;
// Your Account SID and Auth Token from twilio.com/console
$account_sid = 'ACACXXXXXXXXXXXXXXXXXXXXXXXXXXXX';
$auth_token = 'my auth token';
// In production, these should be environment variables. E.g.:
// $auth_token = $_ENV["TWILIO_ACCOUNT_SID"]
// A Twilio number you own with Voice capabilities
$twilio_number = "+99999999999";
// Where to make a voice call (your cell phone?)
$to_number = "+99999999999";
$client = new Client($account_sid, $auth_token);
try {
$call = $client->account->calls->create(
$to_number,
$twilio_number,
array(
"url" => "http://demo.twilio.com/docs/voice.xml"
)
);
echo "Call: " . $call->sid;
} catch(Exception $e) {
echo "Error: " . $e->getMessage();
}
现在,我尝试了所有与cacert.pem文件相关的操作,但是它不起作用。我还尝试在php.ini文件中添加“ openssl.cafile =“ C:\ xampp \ php \ cacert.pem”,并尝试重新启动apache服务器,但这不起作用。
我已经在我的php.ini中有了它。
[curl]
curl.cainfo="C:\xampp\php\cacert.pem"