ID: 46814 User updated by: dennis dot birkholz at nexxes dot net Reported By: dennis dot birkholz at nexxes dot net Status: Open Bug Type: Scripting Engine problem Operating System: Gentoo/Linux PHP Version: 5.2.8 New Comment:
This IS a bug: in Linux (and Unix like systems) beeing in a symlinked directory should behave exactly like beeing in a directory with the same content. To use my example: If I use a shell and change to the folder /htdocs/test2 (which is a symlink to /test1), ls ../docs/docs.inc.php will show me the file "/htdocs/docs/docs.inc.php" and NOT "/docs/docs.inc.php". Previous Comments: ------------------------------------------------------------------------ [2008-12-17 16:53:29] php at degoulet dot net quite normal : not a bug ------------------------------------------------------------------------ [2008-12-09 18:17:42] dennis dot birkholz at nexxes dot net Description: ------------ include statement seems to resolve the current working directory other than the rest of php so if I am in a symlinked directory an try to include a file using a relative path (containing ../), the include fails because the original path of the script is used to resolve the relative include and not the path the script is invoked from. Reproduce code: --------------- Asume the following files/directory structure: Directory /test1 Directory /htdocs Directory /htdocs/docs Symlink /htdocs/test2 -> /test1 File /test1/index.php File /htdocs/docs/docs.inc.php DocumentRoot is /htdocs File-Contents of /test1/index.php <?php include("../docs/docs.inc.php"); // ... other code ?> Expected result: ---------------- No error, output generated by code after the include Actual result: -------------- An error: failed to open stream: No such file or directory (/test1/index.php:2) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46814&edit=1