Fatal error: Call to undefined method stdClass::stream_publish()
<p>Well I am trying to post on facebook's wall but I get this error:
---> "Fatal error: Call to undefined method stdClass::stream_publish() "</p>

<p>The code I am trying is this</p>

<pre><code>&lt;?php

define('FB_APIKEY', '&lt;Your Api Key&gt;');
define('FB_SECRET', '&lt;Secret&gt;');
define('FB_SESSION', '&lt;Session&gt;');

require_once('facebook.php');

echo "post on wall";
echo "&lt;br/&gt;";

try {
 $facebook = new Facebook(FB_APIKEY, FB_SECRET);
 $facebook-&gt;api_client-&gt;session_key = FB_SESSION;
 $facebook-&gt;api_client-&gt;expires = 0;
 $message = '';

 $attachment = array(
 'name' =&gt; $_POST["name"],
 'href' =&gt; $_POST["href"],
 'description' =&gt; $_POST["description"],
 'media' =&gt; array(array('type' =&gt; 'image',
 'src' =&gt; $_POST["src"],
 'href' =&gt; $_POST["href"])));

 $action_links = array( array('text' =&gt; 'Visit Us', 'href' =&gt; '&lt;link to some place here&gt;'));

 $attachment = json_encode($attachment);
 $action_links = json_encode($action_links);

 $target_id = "&lt;Target Id&gt;";
 $session_key = FB_SESSION;

 if( $facebook-&gt;api_client-&gt;stream_publish($message, $attachment, $action_links, null, $target_id)) {
 echo "Added on FB Wall";
 }
} catch(Exception $e) {
 echo $e . "&lt;br /&gt;";
 }
?&gt;
</code></pre>
