Have script path with unresolved symlinks in PHP?
问题 Let's say we have a web directory with the following paths: framework/ index.php ... instance/ index.php -> ../framework/index.php (symlink) ... If we now make a request for (...)/instance/index.php PHP will resolve the symlinks and set __FILE__ as (...)/framework/index.php Is there a way around this so e.g. dirname(__FILE__) would be (...)/instance ? EDIT: Since it has been pointed out, I'm actually not sure if PHP itself is resolving the links or something else. In my case I'm using nginx