问题描述
我想使用PHP-SDK连接到Facebook的图形API。正在创建会话正常,但我收到以下错误
I'm trying to connect to Facebook's graph api using the PHP-SDK. The session is being created fine, however I'm getting the following error
Fatal error: Uncaught CurlException: 1: Protocol https not supported or disabled in libcurl thrown in .../app/vendors/facebook/graph/facebook.php on line 622
我尝试通过在第600行将以下行添加到facebook.php中来纠正此错误。
I have tried to correct this by adding the following lines to facebook.php at line 600
$opts[CURLOPT_SSL_VERIFYPEER] = false;
$opts[CURLOPT_SSL_VERIFYHOST] = 0;
禁用SSL检查,但我仍然收到相同的错误。我如何解决这个问题,以便我可以与FB API进行交互?我需要重新编译cURL或者应该为FB添加证书吗?
to disable the SSL checking, but I am still getting the same error. How can I fix this issue so that I can interact with the FB api? Do I need to recompile cURL or should I add a certificate for FB?
推荐答案
看来您的PHP版本尚未使用SSL支持编译。 (始终验证对等体证书和主机名使用HTTPS时,顺便说一下)。
It looks like your version of PHP hasn't been compiled with SSL support. (Always verify the peer certificate and the host name when using HTTPS, by the way).
这篇关于cURL与HTTPS和Facebook Graph API有关的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!