How to Access Server and execution environment information ($_SERVER or document root path) from (Custom) PHP Extension
<p>I just started writing my own PHP Extension by following the tutorial at </p>

<p><a href="http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/" rel="nofollow">http://blog.slickedit.com/2007/09/creating-a-php-5-extension-with-visual-c-2005/</a></p>

<p>And it works great for me.</p>

<p>My problem started when I try to read a file(path relative to calling .php script) using this extension. I observed that the <code>"Document Root Path"</code> of the calling .php file and the<code>executing PHP extension</code> are <code>different.</code></p>

<p>So:-</p>

<ol>
<li><p>How to <strong>access the "Document Root Path"</strong> of the calling .php file.</p></li>
<li><p>How to <strong>access other Server and execution environment information</strong>. (values present in $_SERVER and/or $_ENV)</p></li>
</ol>
