ID:               30881
 Updated by:       [EMAIL PROTECTED]
 Reported By:      ovdspek at liacs dot nl
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Debian Linux Sarge
 PHP Version:      4.3.9
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is expected, and we can not change this as it will break a lot of
scripts.


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

[2004-11-24 14:25:06] ovdspek at liacs dot nl

Description:
------------
In PHP, includes (appear to) use the current working directory. In C++,
includes use the directory of the including script (and the include
path).

Could the C++ behaviour be added to PHP includes?
Because if relative includes are used, current PHP scripts can only be
executed if cwd == script dir.

Reproduce code:
---------------
$ cat 1.php 
<?php
        echo "1.php<br>\n";
?>

$ cat b/2.php 
<?php
        include('../1.php');
?>

$ php -f b/2.php 

Warning: main(../1.php): failed to open stream: No such file or
directory in /home/olaf/t/a/b/2.php on line 2

Warning: main(): Failed opening '../1.php' for inclusion
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/olaf/t/a/b/2.php on line 2

$ cd b

$ php -f b/2.php 
Could not open input file: b/2.php.

$ php -f 2.php 
1.php<br>

$ 

Expected result:
----------------
Warning: main(../1.php): failed to open stream: No such file or
directory in /home/olaf/t/a/b/2.php on line 2

Warning: main(): Failed opening '../1.php' for inclusion
(include_path='.:/usr/share/php:/usr/share/pear') in
/home/olaf/t/a/b/2.php on line 2


Actual result:
--------------
1.php<br>



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=30881&edit=1

Reply via email to