title: How to post to a Facebook page with PHP
body: <p>I would like to post to my own Facebook page's wall from my website using PHP.</p>
  <p>I have the following:</p>
  <ul>
  <li><strong>Facebook Application</strong> with AppID, AppSecret, ApiKey</li>
  <li><strong>Facebook Page</strong> with PageID</li>
  <li><strong>my own Facebook account</strong> - I'm the admin and the creator of the application and page mentioned above.</li>
  </ul>
  <p>E.g. I write a blog post, and I'd like to get the name, the short description and a picture on my Facebook page's wall. Or I would like to publish some articles on the Facebook page every day automatically as a cron job.</p>
  <p>Could you provide a <strong>step-by-step</strong> tutorial how to accomplish this?</p>
  <p>I've read this article about Facebook Login:<br />
  <a href="https://developers.facebook.com/docs/facebook-login/" rel="noreferrer">https://developers.facebook.com/docs/facebook-login/</a><br />
  but I still don't know what to write in my code.</p>
  <hr />
  <h3>UPDATE 1</h3>
  <p>This is how I send a request for an App Access Token:</p>
  <pre><code>$url = 'https://graph.facebook.com/oauth/access_token?grant_type=client_credentials&amp;client_id='
          .Yii::app()-&gt;params['FacebookAppID']
          .'&amp;client_secret='
          .Yii::app()-&gt;params['FacebookSecret'];
  </code></pre>
  <p>The response is similar to this (fake symbols):</p>
  <p><code>access_token=326584076429|ax3-D39YbpDcR9rMRQn_fMvNu_s</code></p>
  <p>What <code>access_token</code> is it? Application Access Token? How to get a User Access Token?</p>
  <p>I tried to use the access token from here:<br />
  <a href="https://developers.facebook.com/tools/explorer?method=GET&amp;path=me%2Faccounts" rel="noreferrer">https://developers.facebook.com/tools/explorer?method=GET&amp;path=me%2Faccounts</a>
  but I got the following error message:</p>
  <blockquote>
  <p><em>An active access token must be used to query information about the current user</em></p>
  </blockquote>
  <p>So how should I obtain the right access token?</p>
  <h3>UPDATE 2:</h3>
  <p>How can I get the right Facebook tokens in my application without any client interaction?<br />
  I'm the admin and the creator of the Facebook Application and the Facebook Page.</p>