Referring to the public root in PHP - best practices
<p>I've been using the $_SERVER["DOCUMENT_ROOT"] environment variable to refer to the public root in my apps. Now I'm realizing that that's not very reliable. I'm thinking about an approach where I define a constant in my index.php based on a magic constant. Something like that:</p>

<pre><code>define("PUBILC", __DIR__."/");
</code></pre>

<p>I'm not sure about it though.</p>

<p>What approach would you recommend?</p>
