Using __DIR__
and __FILE__
constants do not work in a symlinked situation. What is the workaround for this?
For example:
I have a file:
/home/me/modules/myfile.php
It is symlinked to:
/var/www/project/app/myfile.php
from in /home/me/modules/myfile.php
i need to include a file that is located in /var/www/project
EDIT
To the suggestions of using realpath() - unfortunately this does not work.
var_dump(__DIR__);
var_dump(realpath(__DIR__));
both return exactly the same filepath