ID:               46814
 Comment by:       php at degoulet 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:

quite normal : not a bug


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to