I am having trouble installing Fb Connect properly. I downloaded/installed the module in the Drupal interface and activated the module. I followed the instructions in the ReadMe file, but it all falls apart with the facebook.php file.
Step 2 says: "2. Upload facebook-php-sdk/src/facebook.php (http://github.com/facebook/php-sdk/) into fbconnect module folder (or into libraries folder,
if you want to use it with the libraries module, http://drupal.org/project/libraries)
To ensure that you installed correctly check file : /facebook.php must be accessible
OR /sites/all/libraries/facebook/facebook.php must be accessible"
I went to the link, found facebook.php, and did 'Save target as..." to the fbconnect module folder. After I did this, I refreshed my drupal site and it oddly loads a github page into the screen for every page on the website. Then I tried placing it in the libraries location that is mentioned in the instructions. Same thing happens. The title of the page is changed, but it still has the same localhost/drupal url.
It only reverts back to the normal pages when I remove the facebook.php file. Without the php file, I can go into configure and add the AppID, etc. However, there is an error in the status report asking for facebook.php.
Has this happened to anyone else? Am I doing something silly to cause this problem?
I attached an image of the screen I am redirected to. Here is the rest of the code that shows up on the page if that might help.
"<?php
/**
* Copyright 2011 Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. */
require_once "base_facebook.php";
/** * Extends the BaseFacebook class with the intent of using * PHP sessions to store user ids and access tokens. */
class Facebook extends BaseFacebook{
/** * Identical to the parent constructor, except that * we start a PHP session to store the user ID and * access token if during the course of execution * we discover them. * * @param Array $config the application configuration. * @see BaseFacebook::__construct in facebook.php */
public function __construct($config) {
if (!session_id()) {
session_start(); }
parent::__construct($config); }
protected static $kSupportedKeys = array('state', 'code', 'access_token', 'user_id');
/** * Provides the implementations of the inherited abstract * methods. The implementation uses PHP sessions to maintain * a store for authorization codes, user ids, CSRF states, and * access tokens. */
protected function setPersistentData($key, $value) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to setPersistentData.');
return;
}
$session_var_name = $this->constructSessionVariableName($key); $_SESSION[$session_var_name] = $value; } protected function getPersistentData($key, $default = false) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to getPersistentData.');
return $default; }
$session_var_name = $this->constructSessionVariableName($key); return isset($_SESSION[$session_var_name]) ? $_SESSION[$session_var_name] : $default; }
protected function clearPersistentData($key) {
if (!in_array($key, self::$kSupportedKeys)) {
self::errorLog('Unsupported key passed to clearPersistentData.'); return; }
$session_var_name = $this->constructSessionVariableName($key);
unset($_SESSION[$session_var_name]); }
protected function clearAllPersistentData() {
foreach (self::$kSupportedKeys as $key) {
$this->clearPersistentData($key); }
}
protected function constructSessionVariableName($key) {
return implode('_', array('fb', $this->getAppId(), $key)); }
}"
Thanks.
| Comment | File | Size | Author |
|---|---|---|---|
| fbconnect.jpg | 36.07 KB | casdesign |
Comments
Comment #1
ifeelgood commentedAs of the latest update to support sdk 3.1.1, the readme file was still outdated. You need to copy the contents of the sdk src folder into sites/all/libraries/facebook. It should contain 3 files: facebook.php, base_facebook.php and fb_ca_chain_bundle.crt. Hope this helps you.
Comment #2
casdesign commentedThank you for the reply. Unfortunately, it did not work. I did this, deleted my browsing history, and it is still taking me to the same page. Any other suggestions?
Comment #3
ifeelgood commentedJust to confirm.
Did you download the sdk archive here: https://github.com/facebook/php-sdk/zipball/v3.1.1 ? or did you just use the browser 'Save page as'?
You need to download the archive, extract it, then copied the src files over to libraried/facebook.
Comment #4
casdesign commentedAh-ha! Thank you. I didn't realize that made a difference- but it did.
Comment #5
geofffitch commentedI'm having the same issue and have tried placing the Facebook library in just about every possible location I can determine and cannot get rid of this "Fbconnect : Facebook PHP library not found" error. I've tried placing facebook-php-sdk in site/all/libraries, site/all/modules/libraries, site/all/modules/fbconnect, site/all/modules - i've tried calling it by its original name facebook-php-sdk-g70030b, I've tied placing the src folder in these locations and calling it by these names.
I've tried reading the code of all these modules to see if I can determine what its looking for...
Any idea?
Geoff
Comment #6
geofffitch commentedProblem solved - see http://drupal.org/node/1318296 post #26 and #6
Comment #7
jcisio commentedComment #7.0
jcisio commentedAdd end quote to code