I am working on my second Facebook App and seem to have run into a problem. On my first App, I used
$user_id = $facebook->require_login();
to get the ID of the user that was using my app. It worked great, and still does. Howeve开发者_如何转开发r, on my second App, I used the same thing but keep getting the old 500 Internal Server Error. ( Using Opera as browser ) Not sure why, since the exact same code works on the other App. Here it is:
<?php
require_once('facebook.php');
$appapikey = 'APIKEYHERE';
$appsecret = 'SECRETKEYHERE';
$facebook = new Facebook($appapikey, $appsecret);
$user_id = $facebook->require_login();
echo $user_id;
echo "Hello!";
?>
I have checked the server and PHP logs, none of them report any errors.
500 internal server error ussually comes from an error in your code, not browser related anyway.
Also, the API should work just fine. Try replacing
include 'facebook.php';
with
require_once('facebook.php');
Also, is this everything you have in the code?
How long ago did you write your first app? Facebook has got rid of the old APIs (although left them there for old apps to continue to work), but all new apps have to use the Graph API instead.
Take a look here for more information. http://developers.facebook.com/docs/guides/canvas/
Also, take a look at this documentation. http://developers.facebook.com/docs/api
精彩评论