6

I am using facebook api to get backup of the facebook photos using access_token and fql.

Using fql I got the list of albums of the user

$client = new Facebook(array('appId' => 'xxxx', 'secret' => 'xxxxxx'));
$fql_albums = "SELECT aid,name from album where owner=$user_Id";

$albumId = $client->api(array(
    'method'       => 'fql.query',
    'access_token' => $user_access_token,
    'query'        => $fql_albums,
));

After getting this list I run a query to get all the photos in the album and then download that album and then moves to the next album.

It only download 2 albums and then gets an error as shown below

( ! ) Fatal error: Uncaught CurlException: 28: SSL connection timeout thrown in D:\wamp\www\FrostBox1.0\Facebook\FaceBookConnect\facebook-php-sdk\src\base_facebook.php on line 759

What could I be doing wrong?

RivieraKid
  • 5,923
  • 4
  • 38
  • 47
Asghar
  • 2,336
  • 8
  • 46
  • 79

3 Answers3

18

For me, the solution was adding

$opts[CURLOPT_SSLVERSION] = 3;

before

curl_setopt_array($ch, $opts);

in base_facebook.php

Thanks to: https://developers.facebook.com/bugs/213367445404472/?browse=search_4eeccca164bbe6357503363

andresv
  • 351
  • 4
  • 6
  • This answer fixed it for me too! I think some versions of libcurl don't activate SSLv3 by default – Tony Million Mar 30 '12 at 17:40
  • This fixed it for me as well, after much debugging and even contacting our web host and having them update and reinstall the latest (patched version) of Apache with OpenSSL. Thanks – Radley Sustaire Apr 04 '12 at 15:19
  • set this option even if curl debug says it is already using version 3, a little bug maybe, specifically setting to version 3 this sorted it out for me. – Question Mark Oct 04 '12 at 14:25
16
  1. open base_facebook.php
  2. find CURLOPT_CONNECTTIMEOUT => 10
  3. change it to CURLOPT_CONNECTTIMEOUT => 30

That's it!

Matthias
  • 7,432
  • 6
  • 55
  • 88
Waqas Ali Khan
  • 1,317
  • 13
  • 14
0

I solved it by adding:

CURLOPT_SSLVERSION     => 3,

after the line:

CURLOPT_USERAGENT      => 'facebook-php-3.1',

at - base_facebook.php

(it will make curl to use SSLv3)

Msonic
  • 1,456
  • 15
  • 25