README.txt

Drupal for Facebook comes with a README.txt. This file is more up-to-date than the page you are reading now. Read it from start to finish, carefully. This is guaranteed to save you time in the long run.

Devel Module

Did you download and enable Devel? Remember, fb_devel.module requires the devel module which is a separate download.

Once fb_devel and the devel module are enabled, add the block that fb_devel.module provides called "Facebook Devel Page info" to the footer section of your theme which should look like this:

Remember that devel module will only show messages to users with "access devel content" permission. When troubleshooting, it's often helpful to grant both anonymous and authorized users this permission.

Disable conflicting modules

Disable any other module's which offer any sort of Facebook integration. These often use older/different versions of Facebook's PHP or Javascript. So for example if you've downloaded fbconnect or fb_social or any Facebook related module which is not Drupal for Facebook (modules/fb/...), disable those modules and try to reproduce the problem.

Users have also reported problems with Global Redirect, purl and possibly any module which implements custom url rewriting. Disable those modules as well, and try to reproduce the problem.

Public domain

Each application needs to be hosted somewhere, and to work properly with Facebook it must be hosted where Facebook can see it.

This means if you're browsing URLs like http(s)://localhost/... or http(s)://127.0.0.1/..., then you're browsing a server that Facebook cannot see, and things will not work.

You need a domain and DNS setup that the outside world (Facebook.com) can reach. This article may help you set that up.

Third-party cookies

Make sure your browser is accepting cookies, and third-party cookies. Both canvas pages and Facebook Connect pages may not work properly in browsers where cookies are not accepted.

In particular by default, Safari does not accept third-party cookies. And see the note below particular to IE and canvas pages.

So when troubleshooting, if third-party cookies are disabled, test with them enabled and see if that is the problem.

Changing fb_apikey in settings.php

As noted on the Installation-Application page, If (a) you have more than one application enabled under Admin >> Site Building >> Facebook Apps, and (b) one of those apps is Facebook Connect (as opposed to just canvas pages), then the $conf['fb_id'] in settings.php (usually in directory /sites/default) should be changed to the app id for the Facebook Connect application. Otherwise, you will get an error like below after you save the application:

To fix this error, you must go into directory /sites/default/settings.php and change this specific line of code below to replace the '123...XYZ' with your own application's specific app id which Facebook generated for you when you created a Facebook application on your Drupal site. (You can find that under admin >> site building >> Facebook Apps.)
//$conf['fb_id'] = '123.....XYZ'; // Your connect app's id goes here.

So, now the correct code should look something like this, with the apikey that you learned from Facebook:
$conf['fb_id'] = '4998126732'; // Don't copy this value, use your own.

iFrame Canvas Pages Using Internet Explorer

Some browsers, like Internet Explorer, will not accept cookies from your iframe canvas page application, at least not without some assurance regarding your site's privacy policy. Adding P3P headers to your canvas page can get around this problem. However, only add P3P headers if you understand them and are certain that your site conforms to the policy they imply. See http://www.w3.org/TR/P3P/.

You can add these headers to your pages with code such as the following, which can be placed at the end of your settings.php:

header('P3P: CP="CAO PSA OUR"');

Pathol2187 reports,

I used header('P3P: CP="We do not have a P3P policy"'); and everything seems to be working fine now.

Issue Queue

The project issue queue is another place to look for answers. Probably, you're not the first to encounter your problem. If you're lucky enough to be first, save others time by describing your problem on the issue queue.

If you can't access the page or are getting some funky errors try these:

  • Your Facebook API key, Secret key, or Application page are incorrect.
  • Double check that you have registered your application at developer.facebook.com, and that you have entered the correct values in Drupal.

  • You didn't download and install the correct Facebook platform.
  • See prerequisites and installation.