Question:

The PHP SDK does not work for me. Whenever I include facebook.php that in my script, the script stop its processing. I have checked that the correct version of the PHP SDK (i.e. facebook.php) is used already.

For example, by using the following script, I can only see "TEST 1" displayed.

<?php
   echo 'TEST 1';
   require 'facebook.php';
   echo 'TEST 2';
?>

So, what's wrong?

 

 

Answer:

Appreciate if you can like this page if you find it useful! - Click "Like"

If your script does not work just my including facebook.php, there is probably something "wrong" with your web server. The PHP SDK requires CURL and JSON PHP extensions.

To figures what is wrong, try to run the following script.

<?php
  if (!function_exists('curl_init')) {
     echo "Facebook needs the CURL PHP extension.";
  }
  if (!function_exists('json_decode')) {
     echo "Facebook needs the JSON PHP extension.";
  }
?>

 

 

 

Find my FAQ on Facebook Development useful? Download the PDF for all the FAQs HERE!