2015-04-30 81 views
0

我在運行簡單的Twilio代碼時遇到了一些麻煩。 這是我的代碼:`Twilio'CONNECT'後收到來自代理的HTTP代碼403

<?php include "twilio-php-master/Services/Twilio.php"; 
$sid = 'AC***'; 
$token = '[token]'; 
$version= '2010-04-01'; 
$client = new Services_Twilio($sid, $token, $version); 
$client->account->calls->create('+390550620591', '+393386432173','http://demo.twilio.com/welcome/voice/'); 
?> 

它提供了以下錯誤:

Fatal error: Uncaught exception 'Services_Twilio_TinyHttpException' with message 'Received HTTP code 403 from proxy after CONNECT' in /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/TinyHttp.php:119 
Stack trace: 
#0 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio.php(183): Services_Twilio_TinyHttp->__call('post', Array) 
#1 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio.php(183): Services_Twilio_TinyHttp->post('/2010-04-01/Acc...', Array, 'To=%2B393386432...') 
#2 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/ListResource.php(92): Base_Services_Twilio->createData('/2010-04-01/Acc...', Array) 
#3 /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/Rest/Calls.php(32): Services_Twilio_ListResource->_create(Array) 
#4 /membri/testtwilio/MakeCall/index.php(20): Services_Twilio_Rest_Calls->create('+390550620591', '+393386432173', 'http://demo.twi...') 
#5 {main} thrown in /membri/testtwilio/MakeCall/twilio-php-master/Services/Twilio/TinyHttp.php on line 119 

我使用altervista主辦。

回答

0

轉到您的altervista控制面板>>編輯PHP設置>>

然後你需要通過發送短信來驗證您的帳戶,否則您將無法連接到twilio API ..修正了和一切都應該好去..