views:

79

answers:

1

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

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;

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?

+1  A: 

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).

Bruno
Thanks for the reply. I have the following two lines under the Curl section of phpinfo()
cURL support enabledcURL Information libcurl/7.19.5 zlib/1.2.3 libidn/0.6.5
What about OpenSSL support? (Google for PHP, libcurl and OpenSSL)
Bruno
also 'Configure Command' contains '--with-openssl' does that mean that ssl is supported?
Does the *curl* section in `phpinfo` have an *SSL Version* row? Do you have an *OpenSSL* section in `phpinfo`?
Bruno
There is an OpenSSL section which reads enabled and "OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008", however Curl information reads " libcurl/7.19.5 zlib/1.2.3 libidn/0.6.5 ". Does that mean I need to recompile PHP or just install the PHP-Curl bindings (sorry, I'm completely new to all this, normally just a coder)
Yes, it sounds like libcurl didn't have ssl enabled. You might need to recompile or install it from another package (it depends on your environment/platform).
Bruno
I recompiled curl and php to enable SSL and now it's working fine, thanks for the help