Troubleshooting problems when hard-link and sym-link are different. for example:
echo getcwd();
echo "<br>";
echo realpath(dirname(__FILE__));
echo "<br>";
echo readlink($_SERVER['DOCUMENT_ROOT']);
echo "<br>";
echo substr(realpath(dirname(__FILE__)), strlen($_SERVER['DOCUMENT_ROOT']));