As you are no doubt aware, recently Facebook unveiled a new suite of APIs that we can use in our own applications. IP.Board already had existing integration via Facebook Connect but we decided to move over to the new Graph APIs for IP.Board 3.1 and be right on the curve.
As IP.Board is used on thousands of different hosting machines, we are used to making our code as portable as possible. This usually means ensuring there is fallback functionality for common PHP extensions.
The official PHP SDK is at github.com. It’s very early days so it hasn’t fully matured. It has no fallback methods when CURL isn’t available which is more common that you think. It also has a small bug with the CURL methods for Windows machines (IIS). None of these are huge problems but we had to fix them as we had no control over the hosting environments used.
Rather than manually patch the files, I simply forked the project so I can merge it with the official distribution for our own use. I also issued a pull request. Hopefully the Facebook developers will integrate the changes into their core code.
Until they do, you are welcome to use my Facebook PHP SDK github fork which fixes the following issues:
- Socket POST fallback for when CURL isn’t available
- SSL_VERIFYPEER fix for IIS hosting environements
- ‘curl_setop_array’ check for PHP < 5.1.3
Github.com was an excellent choice for hosting their source code, and I congratulate them for making it so easy to fork and fix.
Also, please note that I am maintaining this fork personally, not Invision Power Services.

{ 10 comments… read them below or add one }
Hi,
thanks for your modified Facebook API. It helped me a lot!
I was just thinking maybe it would be a good idea to try to use non-Curl way when the standard Curl throws an exception. That was for instance my issue. I left a comment here http://github.com/facebook/php-sdk/issues/#issue/121
have a nice day,
Martin
Hi Martin,
Thanks for the comments. I have updated the facebook.php file to fix the CURL error 77 issue you were having.
Thank you very much for the 77 error, your fork worked great for me !
Regards,
Anthony
fsockopen() [function.fsockopen]: unable to connect to ssl://api-read.facebook.com:443 (Unable to find the socket transport “ssl” – did you forget to enable it when you configured PHP?)
I can’t use it on my server ?
I have a problem. There is a CurlException when I call the function $facebook->api(‘me’);
[message] => Couldn’t resolve host ‘graph.facebook.com’
Could anyone help me, please ?
I see that now and again. If you have access, check your etc/hosts file. If you do not have access or everything seems in order, I’d deliberately sabotage the script to force it to bypass CURL and use the POST fallback. I need to update the fork to keep up with recent Facebook API changes. I’ll add a constant in to easily disable CURL for this reason.
Привет ребят подскажите как интегрировать код на phpbb3?
when i pressed connect with facebook button
i redirected to facebo0k login page
after successful loging i redirected to ur example.php page
but message gives “session you are not connected” why?
please rectify this urgently
I adore you boy!!! you save me a lot of headache! Thanks