title: How to get currently logged on windows username in PHP without windows authentication
body: <p>How to get current logged windows username by php without windows authentication?</p>
  
  <p>I have tried below all the functions before, it display server's <code>username</code></p>
  
  <pre><code>&lt;?php 
  echo getenv("HOMEDRIVE") . getenv("HOMEPATH");
  
  echo 'Current script owner: ' . get_current_user();
  
  echo getenv("username"); 
  
  echo    $_SERVER['LOGON_USER'];
  
      echo $_SERVER['AUTH_USER'];
      echo $_SERVER['REDIRECT_LOGON_USER'];
      echo $_SERVER['REDIRECT_AUTH_USER'];
  
  ?&gt;
  </code></pre>