Thunderstruck
Thunderstruck

Reputation: 345

How to use facebook php sdk in google app engine?

I am trying to use facebook php sdk in my app engine php application. But it gets an error.

when i use the statement require 'facebook.php' , it generates an error with the message-

Facebook needs the CURL PHP extension

how do i get over with that exception?

Upvotes: 1

Views: 1233

Answers (4)

HalfBrian
HalfBrian

Reputation: 887

This question is quite old, hence the previous answers. Anyone looking for an up-to-date solution can just download v5 or greater of the official Facebook PHP SDK. It natively supports various HTTP clients, Curl and HttpStreams included.

I just followed the installation instructions provided in their PHP SDK Getting Started guide and it works on my GAE instance with no configuration or patching.

Upvotes: 0

Ahsanity
Ahsanity

Reputation: 13

If anyone is looking to use the latest (version 4) Facebook SDK for PHP with Google App Engine, they can use this fork: https://github.com/ahsanity/facebook-php-sdk-v4-without-curl

The official SDK uses Curl to make all the API calls, making it unusable in environments that doesn't have the PHP Curl module enabled (example: Google App Engine)

This fork checks if PHP Curl module is enabled. If not, it falls back to using Http streams (via file_get_contents()). If Curl is detected, it uses Curl just like the official SDK.

Upvotes: 1

user3275764
user3275764

Reputation: 61

this library replaces curl with php http stream functions https://github.com/azayarni/purl

Upvotes: 0

Stuart Langley
Stuart Langley

Reputation: 7054

Use this branch of the SDK, that has http streams support.

https://github.com/camfitz/facebook-php-sdk

Upvotes: 1

Related Questions