title: getLoginUrl : The parameter app_id is required
body: <p>I am trying to integrate facebook authentication in a php website.</p>
  
  <p>I used below code:</p>
  
  <pre><code>&lt;?php
      require '../facebook-php-sdk-master/src/facebook.php';
  
      $app_id = 'some app id';
      $app_secret = 'some secret';
      $app_url = 'http://localhost/some app/';
      $scope = 'email,publish_actions';
  
      // Init the Facebook SDK
      $facebook = new Facebook(array(
                                     'appId'  =&gt; $app_id,
                                     'secret' =&gt; $app_secret,
                                     ));
  
      // Get the current user
      $user = $facebook-&gt;getUser();
  
      // If the user has not installed the app, redirect them to the Login Dialog
      if ($user &lt;&gt; '0' &amp;&amp; $user &lt;&gt; '') { /*if valid user id i.e. neither 0 nor blank nor null*/
          try {
          $loginUrl = $facebook-&gt;getLoginUrl(array(
                                                   'scope' =&gt; $scope,
                                                   'redirect_uri' =&gt; $app_url,
                                                   ));
          die('&lt;script&gt;top.location.href="'.$facebook-&gt;getLoginUrl($params).'";&lt;/script&gt;');
          }
          catch (FacebookApiException $e) { /*sometimes it shows user id even if user in not logged in and it results in Oauth exception. In this case we will set it back to 0.*/
              error_log($e);
              $user = '0';
          }
      }
      else
      {
          echo 'user not found';
      }
  ?&gt;
  </code></pre>
  
  <p>Problem is:</p>
  
  <blockquote>
    <p>Though I am specifying and using correct app id, I am always getting
    this error message- <strong>The parameter app_id is required.</strong></p>
  </blockquote>
  
  <p>I think I am facing similar problem- <a href="https://stackoverflow.com/questions/16915180/still-getting-the-parameter-app-id-is-required-error-on-facebook-api-login">till getting “The parameter app_id is required” error on Facebook API login</a>, but there is no accepted answer to that question.</p>
  
  <p>Please suggest if I am missing anything.</p>