简体   繁体   中英

Facebook PHP SDK Problems

I have problems with facebook SDK, I use this code:

$facebook = new Facebook(array(
       'appId'  => 'MY_API_KEY',
       'secret' => 'MY_API_SECRET',
       'cookie' => true,
));

 $fql = "My fql query";

 $response = $facebook->api(array(
     'method' => 'fql.query',
     'query' =>$fql,
 ));
 print_r($response);

Works fine, but after a while returns an error like: " Uncaught CurlException: 3: No URL set! "

That problem appear for few minute (5-10 minutes) and after that works again. The big problem is that error appear few times at hour, somebody know how can I fix that problem?

I think you have set the default responseURL .

May be this is cause

example :- php codes

$params = array(
  'scope' => 'read_stream, friends_likes',
  'redirect_uri' => 'https://www.myapp.com/post_login_page'
);

$loginUrl = $facebook->getLoginUrl($params);

hope this solves the problem .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM