title: HTTP authentication with PHP not work on server
body: <p>I use the Runcloud as my VPS control panel.
  then my environment is "NGINX + Apache2 Hybrid"</p>
  
  <p>I use these code to do the authentication on my localhost , it works.
  But when I deploy(upload) it to the server , it fail.
  I input the correct username and password and it pop up the window and let me input again util I click "Cancel" button and turn to the fail page. </p>
  
  <p>How can I debug this (check the input username password) ? Or I need to add setting to the server.</p>
  
  <pre><code>&lt;?php
  $protect = true;
  if($protect){
          $LoginSuccessful = false;
  
          if (isset($_SERVER['PHP_AUTH_USER']) &amp;&amp; isset($_SERVER['PHP_AUTH_PW'])){
  
              $Username = $_SERVER['PHP_AUTH_USER'];
              $Password = $_SERVER['PHP_AUTH_PW'];
  
              if ($Username == 'hello' &amp;&amp; $Password == 'hello'){
                  $LoginSuccessful = true;
              }
          }
          if (!$LoginSuccessful){
  
              header('WWW-Authenticate: Basic realm="Secret page"');
              header('HTTP/1.0 401 Unauthorized');
  
              print "Login failed!\n";
              die();
          }
      };
  ?&gt;
  &lt;html code&gt;
  </code></pre>