Public stream to facebook's user wall with php?-Collection of common programming errors

I build a facebook app with php api, everything work fine just have a problem when i need public a message on user’s Wall.

my code bellow

$appapikey = "xxxxxx";
$appsecret = "xxxxxx";
$facebook = new Facebook($appapikey, $appsecret);
$fb_user = $facebook->require_login();
if (!$facebook->api_client->users_hasAppPermission("publish_stream, status_update")){
    echo 'Click here to grant permissions to update your status and publish to your stream.';

    try {
    } catch (Exception $e) {
        echo "Public error".$e->getMessage();

I had allow Permission for publish_stream but still get error

Uncaught exception 'FacebookRestClientException' with message 'Unauthorized source IP address (ip was:'
Stack trace:
#0 /home/flexvnne/public_html/facebook/facebook/client/facebookapi_php5_restlib.php(345): FacebookRestClient->call_method('facebook.users....', Array)
#1 /home/flexvnne/public_html/facebook/index.php(36): FacebookRestClient->users_getInfo('625757897', 'username')
#2 {main}
  thrown in /home/flexvnne/public_html/facebook/facebook/client/facebookapi_php5_restlib.php on line 1314
[16-Oct-2009 01:30:53] PHP Fatal error:  Uncaught exception 'FacebookRestClientException' with message 'Unauthorized source IP address (ip was:' in /home/flexvnne/public_html/facebook/facebook/client/facebookapi_php5_restlib.php:1314

Anyone known way to solved that problem ?

  1. It looks like your users_getInfo() call is the one that is failing here, not stream publishing. My guess is check your whitelist/blacklist in your facebook developer application app settings — your IP might be restricted.

Originally posted 2013-11-19 13:18:37.