PHP __DIR__ or __FILE__ symlinked
<p>Using <code>__DIR__</code> and <code>__FILE__</code> constants do not work in a symlinked situation.  What is the workaround for this?</p>

<p>For example:</p>

<p>I have a file:</p>

<pre><code>/home/me/modules/myfile.php
</code></pre>

<p>It is symlinked to:</p>

<pre><code>/var/www/project/app/myfile.php
</code></pre>

<p>from in <code>/home/me/modules/myfile.php</code> i need to include a file that is located in <code>/var/www/project</code></p>

<p>EDIT</p>

<p>To the suggestions of using realpath() - unfortunately this does not work.</p>

<pre><code>var_dump(__DIR__);
var_dump(realpath(__DIR__));
</code></pre>

<p>both return exactly the same filepath</p>
