Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i got a error Fatal error: Class 'Facebook\Entities\AccessToken' not found #16

Closed
Nathan-Srivi opened this issue Sep 23, 2014 · 5 comments

Comments

@Nathan-Srivi
Copy link

Hi,
i integrate facebook ads api into my server. 80% of works are completed in server. but finally i got a issue

Fatal error: Class 'Facebook\Entities\AccessToken' not found

Many pages i saw this code

use Facebook\FacebookSession;

so i include facebook sdk into my src folder. but no use. please help me where i put facebook sdk and please guide me how can i solve the issue please help me.

@paulbain
Copy link
Contributor

Did you follow the developer guide?

Sounds like you probably aren't including the autoloader:

<?php
define('VENDOR_DIR', '/path/to/sdk/'); // Path to the Vendor directory 
$loader = include VENDOR_DIR.'/vendor/autoload.php';

See this guide:
https://github.com/facebook/facebook-php-ads-sdk/blob/master/DEVELOPER_GUIDE.md

StackOverflow is also a good place to ask these sorts of questions:
http://stackoverflow.com/questions/tagged/facebook-ads-api

@Nathan-Srivi
Copy link
Author

Hi paulbain,

Thanks for your response

when i update this code
'<?php
define('VENDOR_DIR', '/path/to/sdk/'); // Path to the Vendor directory
$loader = include VENDOR_DIR.'/vendor/autoload.php';'

i got this following error,
Fatal error: Class 'Facebook\FacebookSession' not found in

So i include facebook sdk folder into example folder and i include files into my connectionobjects.php like this
require_once( 'Facebook/HttpClients/FacebookHttpable.php' );
require_once( 'Facebook/HttpClients/FacebookCurl.php' );
require_once( 'Facebook/HttpClients/FacebookCurlHttpClient.php' );
require_once( 'Facebook/Entities/AccessToken.php' );
require_once( 'Facebook/Entities/SignedRequest.php');

But now i got this following error,
Fatal error: Class 'FacebookAds\Api' not found

Please help me please

@paulbain
Copy link
Contributor

Did you update the path to the vendor directory where the section says '/path/to/sdk/'?

As this doesn't look like a specific issue with the SDK, I'm going to close this out, and recommend you ask programming questions on the stackoverflow:
http://stackoverflow.com/questions/tagged/facebook-ads-api

@Nathan-Srivi
Copy link
Author

Hi paulbain,

Please look at my final edited comment. this is my last question. please help me

@paulbain
Copy link
Contributor

Did you install from composer or from github? You should use composer as it includes the correct version of the Facebook PHP SDK.
You should also use the autoloader in the vendor directory and not include the files yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants