1
votes

I want to login with facebook using facebook sdk php in codeigniter.

i have use facebook libary in applications/libraries/Facebook.php

and full sdk path in applications/vendor

config of my facebook app_id and app_secret in config folder config/facebook.php

in autoload.php i load facebook library

$autoload['libraries'] = array('facebook','database','form_validation','session');

But i got an error Unable to load the requested class: Facebook

2

2 Answers

1
votes

Maybe you didn't changed class name inside Facebook library file, that should be Facebook

  1. Check Facebook file exist on libraries folder.
  2. Class name and file name of library must be same. check it, even capital and small letters.

Check class name inside Facebook php on library file.

0
votes

Add this two lines on the top in your code. If you are using any different version of Facebook sdk then change as per your folder and version Name.

define('FACEBOOK_SDK_V4_SRC_DIR', __DIR__ . '/facebook-php-sdk-v4-5.0-dev/src/Facebook');
require_once __DIR__ . '/facebook-php-sdk-v4-5.0-dev/src/Facebook/autoload.php';

If steel you are facing problem, then share the exact error what you are getting.