Twilio PHP API库:警告:file_get_contents():SSL操作失败,代码为1 [英] Twilio PHP API Librarie: Warning: file_get_contents(): SSL operation failed with code 1
问题描述
我通过composer("twilio/sdk":〜3.12")安装了官方的Twilio PHP API Librarie.
I installed Official Twilio PHP API Librarie via composer ( "twilio/sdk": "~3.12" ).
当我尝试通过测试凭据使用API(例如发送SMS)时,出现错误消息:
When I trying use API ( for example send an SMS ) using Test Credentials I get the error:
警告:file_get_contents():SSL操作失败,代码为1. OpenSSL错误消息:错误:14090086:SSL 例程:SSL3_GET_SERVER_CERTIFICATE:证书验证失败 ..vendor/twilio/sdk/Services/Twilio/HttpStream.php第62行
Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in ..vendor/twilio/sdk/Services/Twilio/HttpStream.php line 62
如果我尝试使用curl在终端中发送短信-一切正常.
If I trying send SMS in terminal using curl - everything is OK.
如何在不编辑Twilio PHP API Librarie代码的情况下进行修复?
How it may be fixed without editing Twilio PHP API Librarie code?
推荐答案
此处是Twilio开发人员的福音.
Twilio developer evangelist here.
我发现,当您没有PHP的curl绑定时,就会发生这种情况.尝试使用curl重新编译PHP 或
I found this happened when you don't have the curl bindings for PHP. Try recompiling PHP with curl or installing the php5-curl package.
让我知道这是否有帮助.
Let me know if that helps at all.
这篇关于Twilio PHP API库:警告:file_get_contents():SSL操作失败,代码为1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!