Question:

I have been following the tutorials on the PHP SDK on every single step but still I cannot get it works.

The following errors are reported:

Errors while loading page from application
     Parse errors:
FBML Error (line 65): illegal tag "body" under "fb:canvas"
FBML Error (line 298): illegal tag "object" under "fb:canvas"

// similar error msg removed

FBML Error (line 422): illegal tag "param" under "fb:canvas"
FBML Error (line 423): illegal tag "embed" under "fb:canvas"

Runtime errors:
URLExceptionUnable to parse URL: http://
URLExceptionInvalid scheme for url (git://github.com/facebook/php-sdk.git)
Please try again later. We appreciate your patience as the developers of 
My First App PHPSDK and Facebook resolve this issue. Thanks!

 

 

 

Answer:

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

If you are sure that you are following the tutorial in every single-step and there is no problems on your web server. Then please make sure you have downloaded the PHP SDK "correctly".

github.com (the official site of the Facebook's PHP SDK) has changed recently that make downloading the PHP SDK a little bit tricky. If you go to the home page of the PHP SDK and visit the "src/" folder under the directory "php-sdk", you will see the file facebook.php (i.e. the PHP SDK) there.

If you are downloading it by doing a "right-click" and "Save Target As...", then be careful! You probably end up with downloading the "web page" which formats the facebook.php file nicely for display (as shown below)!

Facebook dashboard header

To download it, do the "right-click" and "Save Target As..." on the "raw" button (circled in red in the above screen).

The facebook.php that you downloaded should be something like:

<?php
if (!function_exists('curl_init')) { throw new Exception('Facebook needs the CURL PHP extension.'); } if (!function_exists('json_decode')) { throw new Exception('Facebook needs the JSON PHP extension.'); } /** * Thrown when an API call returns an exception. * * @author Naitik Shah <naitik@facebook.com> */ class FacebookApiException extends Exception { . . .

 

 

 

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