Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Facebook Connect error


Go to End


12 Posts   3750 Views

Avatar
Pix

Community Member, 158 Posts

16 October 2014 at 7:37am

I installed the Facebook Connect Integration Module on an SS 3.1.6 site like so:

composer require "wilr/silverstripe-facebookconnect" "dev-master"

and when I run dev/build I am getting:

Fatal error: Class 'Facebook\FacebookSession' not found in /Applications/mampstack-5.4.33-0/apache2/htdocs/ss/facebookconnect/code/extensions/FacebookControllerExtension.php on line 100

How to fix?

Thanks!

Avatar
camfindlay

Forum Moderator, 267 Posts

16 October 2014 at 8:56am

Perhaps double check that the require facebook/php-sdk-v4 dependancy was pulled in correctly by composer since the Facebook\FacebookSession class is part of that.

Avatar
Pix

Community Member, 158 Posts

16 October 2014 at 9:43am

Hi Cam,

Thanks for the reply. I found Facebook.php in:

vendor/facebook/php-sdk-v4/src/Facebook/Facebook.php

So I think it must have been installed. Would that work? Or does it need to be alongside the Facebook Connect Integration Module? I do not see where it is required in that module, but in facebookconnect/code/extensions/FacebookControllerExtension.php I do see:

use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;

Thanks

Avatar
Pix

Community Member, 158 Posts

8 November 2014 at 5:31pm

Anyone have any idea on this? I've verified the Facebook SDK is there but I am still getting

Fatal error: Class 'Facebook\FacebookSession' not found in /Applications/mampstack-5.4.33-0/apache2/htdocs/ss/facebookconnect/code/extensions/FacebookControllerExtension.php on line 100

Avatar
Pix

Community Member, 158 Posts

9 November 2014 at 3:41pm

Edited: 09/11/2014 3:43pm

So then I say to myself maybe this just won't work on a localhost for whatever reason, or maybe it doesn't load the Facebook SDK because the site is running in a subdirectory, or maybe my installation is messed up somehow, who knows. I'll try anything. So in my desperation I use a brand new server, fresh off the farm, not a local host thing. I Install Apache, PHP54, mySql. Then I create a brand new SS project, using composer of course. Then I do:

composer require "wilr/silverstripe-facebookconnect" "dev-master"

And after everything I get:

Fatal error: Class 'Facebook\FacebookSession' not found in /var/www/html/facebookconnect/code/extensions/FacebookControllerExtension.php on line 100

Imagine that. Please, anyone, any ideas?

Avatar
camfindlay

Forum Moderator, 267 Posts

10 November 2014 at 1:53pm

Unsure what the issue is, I might have a go at installing and see if I get the same issue.

Perhaps also raise an issue on the module maintainer's github repository?

Avatar
camfindlay

Forum Moderator, 267 Posts

10 November 2014 at 2:31pm

Managed to replicate the same bug at my end, I think you should raise the issue on https://github.com/wilr/silverstripe-facebookconnect/issueIt's possible that the php sdk from Facebook has changed breaking the module, might have to do some digging.

Avatar
camfindlay

Forum Moderator, 267 Posts

10 November 2014 at 4:02pm

I have logged the issue, I dug into it a bit more and found that there has perhaps been changes to the classes in the facebook sdk master branch.

If you go and git checkout the 4.0-dev branch of the facebook/php-sdk-v4 it seems to fix the issue as a workaround.

Hopefully Wilr can work out the issue and get composer to pull the correct version so that it plays nice with composer and SilverStripe.

Go to Top