How to get the base installation path of a web application
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/390276/how-to-programmatically-determine-the-document-root-in-php">How to programmatically determine the document root in PHP?</a>  </p>
</blockquote>



<p>If a user extracted my web application to <code>/var/www/webapp/</code>, <code>/var/www</code> being the <code>DocumentRoot</code> (so the application would be accessed over <code>example.tld/webapp/</code>), what's the best way to get the installation path <code>/webapp/</code>?<br>
I need this because I got to know about the full absolute URI at some pages of my service.</p>
