title: Posting on user's facebook wall using php 2011
body: <p>Nothing gets posted to the wall, execution gets out of try after  $result = $facebook->api('/me/feed/','post',$attachment); statement, any idea whats broken.</p>
  
  <pre><code>$facebook = new Facebook(array(
    'appId'  =&gt; 'xxxxxxxxxxxx',
    'secret' =&gt; 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  ));
  
  // Get User ID
  
  
  $user = $facebook-&gt;getUser();
  if ($user) {
    try {
      // Get the user profile data you have permission to view
      $user_profile = $facebook-&gt;api('/me');
      $uid = $facebook-&gt;getUser();
  
  
        $url = $facebook-&gt;getLoginUrl(array(
      'canvas' =&gt; 1,
      'fbconnect' =&gt; 0,
      'req_perms' =&gt; 'email,publish_stream,status_update,user_birthday,user_location,user_work_history'));
  
  
      $attachment = array
   (
   'access_token'=&gt;$facebook-&gt;getAccessToken(),
   'message' =&gt; 'I had a question: should I write a PHP facebook app that actually worked?',
   'name' =&gt; 'I Asked Bert',
   'caption' =&gt; 'Bert replied:',
   'link' =&gt; 'http://apps.facebook.com/askbert/',
   'description' =&gt; 'NO',
   'picture' =&gt; 'http://www.facebookanswers.co.uk/img/misc/question.jpg'
   );
   echo "Test 1"; 
  
  $result = $facebook-&gt;api('/me/feed/','post',$attachment);
  
      echo "Test 2"; 
      $_SESSION['userID'] = $uid;
  
  
    } catch (FacebookApiException $e) {
      $user = null;
    }
  } else {
    die('Somethign Strange just happened &lt;script&gt;top.location.href="'.$facebook-&gt;getLoginUrl().'";&lt;/script&gt;');
  }
  </code></pre>
  
  <p>Test 1 is printed but not Test 2.</p>