Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSL Connection timeout in facebook fql

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?

like image 249
Asghar Avatar asked Jun 10 '11 13:06

Asghar


2 Answers

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

like image 97
andresv Avatar answered Oct 21 '22 16:10

andresv


  1. open base_facebook.php
  2. find CURLOPT_CONNECTTIMEOUT => 10
  3. change it to CURLOPT_CONNECTTIMEOUT => 30

That's it!

like image 31
Waqas Ali Khan Puar Avatar answered Oct 21 '22 18:10

Waqas Ali Khan Puar