Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

la-bas's avatar

Facebook PHP SDK v5 and Laravel 5.1 problem

Can't make facebook/php-sdk-v4 (version 5.0) work with Laravel. I know about existing packages, but for various reasons I need to use the official Facebook PHP SDK.

I keep getting this error:

Argument 1 passed to Facebook\FacebookClient::__construct() must be an instance of Facebook\HttpClients\FacebookHttpClientInterface, instance of Facebook\HttpClients\FacebookCurlHttpClient given

My code:

$fb = new Facebook\Facebook([
    'app_id' => Config::get('app.facebook_app.id'),
    'app_secret' => Config::get('app.facebook_app.secret'),
    'default_graph_version' => 'v2.5',
]);
0 likes
2 replies
poldixd's avatar

Do you have a solution for this issue?

Edit:

Ok, this error happend, if you had installed the abandoned package facebook/php-sdk-v4 and the new facebook/graph-sdk

Please or to participate in this conversation.