您好?那里有人吗?
我在几年前就用过这个,现在我回来了。第一次给我这个:
致命错误:/home/www/skyphilly6.com/twill/twilio-php/Services/Twilio/TinyHttp.php:119未捕获的Services_Twilio_TinyHttpException堆栈跟踪:#0 /home/www/skyphilly6.com/twill/twilio -php / Services / Twilio.php(178):Services_Twilio_TinyHttp-> __ call('post',Array)#1 /home/www/skyphilly6.com/twill/twilio-php/Services/Twilio/ListResource.php(92 ):Base_Services_Twilio-> createData('/ 2010-04-01 / Acc ...',Array)#2 /home/www/skyphilly6.com/twill/twilio-php/Services/Twilio/Rest/Calls.php (32):Services_Twilio_ListResource-> _create(Array)#3 /home/www/skyphilly6.com/twill/index.php(9):Services_Twilio_Rest_Calls-> create('8052629166','8058130331','htttttp:/ /demo.twi ...')在第119行的/home/www/skyphilly6.com/twill/twilio-php/Services/Twilio/TinyHttp.php中抛出#4 {main}
这是我的短代码尝试了许多其他行相同的结果:
<?php
require('./twilio-php/Services/Twilio.php');
$version = "2010-04-01";
$account_sid = 'ACcfc1ba0d12c58180319486144bef540e'; $auth_token = 'washere';
$client = new Services_Twilio($account_sid, $auth_token, $version);
$client->account->calls- >create('8052629166','8058133333','htttttp://demo.twilio.com/welcome/voice/');
?>
还尝试取消注释同样的结果:
<?php
require('./twilio-php/Services/Twilio.php');
$version = "2010-04-01";
//$account_sid = 'SK5b9d2d022b971335e17ee50c813ae231'; $auth_token = 'was';
$account_sid = 'ACcfc1ba0d12c58180319486144bef540e'; $auth_token = 'was';
$client = new Services_Twilio($account_sid, $auth_token, $version);
//try {
//$call=
$client->account->calls->create('8052629166','8058133333','htttttp://demo.twilio.com/welcome/voice/');
//,array(
//'Method' => 'GET',
//'FallbackMethod' => 'GET',
//'StatusCallbackMethod' => 'GET',
//'Record' => 'false', ));
//echo 'Started call: ' . $call->sid;
//} catch (Exception $e) { echo 'Error: ' . $e->getMessage(); }
?>
请指出正确的方向。
添加了:
$http = new Services_Twilio_TinyHttp('https://api.twilio.com',
array('curlopts' => array(
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
))
);
//$client = new Services_Twilio($sid, $token, "2010-04-01", $http);
$client = new Services_Twilio($account_sid, $auth_token, $version,$http);
注意到我用于我的令牌同样错误并不重要 找不到错误日志:
$client->http->debug = true;
您好?