I know this has been a problem before, but I've tried everything, and the Fb library will not connect. I'm using the latest DEV's for fbconnect, Libraries API, and the current download from the FB SDK. The SDK is installed where it says to go, and I even made it CHMOD 777 just to be sure. I thought I've gone through all the posts about this, but nothing is left I can find to try and I still get "Facebook PHP library not found". Any idea what I could be missing?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

one_orange_cat’s picture

Don't know if you've tried this, but I only got mine working when I renamed the downloaded SDK folder to 'facebook-php-sdk' and put it in sites/all/libraries.

<edit> Probably useful to note that I have Libraries API module installed! </edit>

wxman’s picture

I'm afraid I already tried that. It's in sites/all/libraries/facebook-php-sdk/src, and the libraries module is installed. Thanks for trying.

one_orange_cat’s picture

Again I'm guessing you've tried this, but as you're using latest dev version of libraries which has the new cache_libraries table (vs recommended) have you tried emptying that table/clearing caches?

wxman’s picture

I'm using Libraries API 7.x-2.0-alpha2+2-dev. I use the admin toolbar, and I use the flush all caches every time. Still no luck.

wxman’s picture

So far I've tried different versions of the SDK, all three versions of the libraries module (currently 7.x-2.0-alpha2), cleared the cache_libraries table, but still nothing. others have this working, so I know it does. What else could I be doing wrong? Could it have something to do bring a multi site?

wxman’s picture

I dug around the code, and made a test edit of fbconnect.module function _facebook_client_load_include(). I started by printing the variable $sdk_path. Every time it came out blank, so I commented out the else:

/**
 * Locates and loads the Facebook PHP SDK library.
 */
function _facebook_client_load_include() {
  if (!class_exists('Facebook')) {
    if (function_exists('libraries_load')) {
      $library = libraries_load('facebook-php-sdk');
 //   }
 //   else {
      $sdk_path = DRUPAL_ROOT . '/sites/all/libraries/facebook-php-sdk/src/facebook.php';
      $library = array('loaded' => file_exists($sdk_path));
      if ($library['loaded']) {
        require_once $sdk_path;
      }
    }
    if (!$library['loaded']) {
      watchdog('fbconnect', 'Unable to load the required Facebook library, please check the README.txt for instructions on how to resolve this.');
    }
  }
  return class_exists('Facebook') && defined('Facebook::VERSION');
}

The library loads perfectly if I leave the else statement commented out.

InternetDevels’s picture

Version: 7.x-2.x-dev » 7.x-2.0-beta4
Component: Miscellaneous » Code
Status: Active » Needs work
FileSize
500 bytes

this patch fixed problem for me

wxman’s picture

Thanks. The patch works here too.

Exploratus’s picture

Had the same issue, this patch fixed it right up. Thanks! Is this commited?

astutonet’s picture

Title: Can't fix the library connect issue » Simple solution to fix the library connect issue
Version: 7.x-2.0-beta4 » 7.x-2.x-dev
Category: Support request » Bug report
Issue summary: View changes
Status: Needs work » Patch (to be ported)

Despite its importance, this module seems rather abandoned and maybe the patch in #7 has not yet been implemented because the category and subject of this post was a support request, not a bug information.

I also had the problems presented in this issue and after trying various solutions, the patch provided solve my problems.

I was leaving the module when I found the solution presented in this post.

Thank you. I hope this patch will be commited soon.

jcisio’s picture

Status: Patch (to be ported) » Needs review

When a patch is "needs work", it has less chance to be reviewed. I don't know why it was NW, to move to NR.

Chris Charlton’s picture

3-4 years later? Bump.

Chris Charlton’s picture

Chris Charlton’s picture

Priority: Normal » Major
Status: Needs review » Reviewed & tested by the community

Patch #7 is good.

Chris Charlton’s picture

(friendly) Bump. :)