1

当我尝试使用 Twilio REST API 发送 SMS 时出现以下错误。

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

代码:

require("Services/Twilio.php");

$account_sid = "ACD123456789"; // Your Twilio account sid
$auth_token = "ACD123456789"; // Your Twilio auth token

$client = new Services_Twilio($account_sid, $auth_token);
$message = $client->account->sms_messages->create(
  '+1415599XXXX', // From a Twilio number in your account
  '+1609531XXXX', // Text any number
  "Hello world!"
);

print $message->sid;
4

1 回答 1

1

您的 PHP 托管环境中是否启用了 JSON 和 cURL?为了让Twilio PHP 帮助程序库在 Joyent 的共享服务器上工作,我必须这样做:

http://carter.rabasa.com/2012/02/10/getting-json-and-curl-enabled-in-php-on-joyent-shared-servers/

如果这不能解决您的问题,您也可以发送电子邮件至 help@twilio.com 寻求支持。

于 2012-06-12T14:38:49.700 回答