I want to connect my page with facebook and downloaded therefore the Facebook PHP SDK 4. Since the Facebook documentation and the GitHub page are not really well made, I have a question regarding my error message from the title.
I don't want to use Composer
for PHP (which should be possible according to the Facebook documentation).
I followed the example on the Github page and included the Facebook PHP files into my PHP file with the following lines of code:
use Facebook\FacebookSession;
use Facebook\FacebookRequest;
use Facebook\GraphUser;
use Facebook\FacebookRequestException;
require_once( 'Facebook/FacebookSession.php' );
require_once( 'Facebook/FacebookRequest.php' );
require_once( 'Facebook/GraphUser.php' );
require_once( 'Facebook/FacebookRequestException.php' );
In the documentation there is nowhere mentioned that I have to include the require_once
statement, I found that on stackoverflow
.
Problem is now that even with the above (correct) implementation, I get an error which says 'Fatal error: Class 'Facebook\GraphObject' not found in ../fblogin2/Facebook/GraphUser.php on line 33'
I think in this class there is also no require_once
statement, but I can't go through the whole SDK code and add the statements for Facebook. Shouldn't it work out-of-the-box? Are there some good tutorials for the SDK 4 or anything else, because I'm really stuck with the official facebook documentation and the short github example.