title: php secure way to detect localhost from server
body: <p>There are a lot of ways for detecting if you are running PHP code on localhost or server. However they use $_SERVER and http header which can be fake by user.</p>
  
  <p>It is serious for me because I have made a developer php <strong>shell interactive</strong> on my website which should go to 404 if it is not on the localhost.</p>