From:             jtaal at eljakm dot nl
Operating system: linux
PHP version:      4.3.11
PHP Bug Type:     Unknown/Other Function
Bug description:  relative include from symbolic linked file

Description:
------------
On my development server I have a directory:
/var/www/app
containing the file:
menu.inc
dbsettings.inc
and the symbolic links
db_mysql.inc -> /var/export/db_mysql.inc
subdir -> /var/export/subdir

In the directory /var/export:
db_mysql.inc
In the directory /var/export/subdir:
include.inc

The file db_mysql.inc has the following line:
require_once("dbsettings.inc");
The file include.inc has the following line:
require_once("../menu.inc");

What happens is that the include_path is ".", so the file ../menu.inc
cannot be found by include.inc

I tried to set the include_path to /var/www/app. This worked for the file
db_mysql.inc, but it didn't work for menu.inc. I tried to set the include
path to ".:/var/www/app", but then the file dbsettings.inc couldn't be
found.
I also tried "/var/www/app:/var/www/app/subdir" and lots of other
combinations.

On a release server the two directories are merged so there will be no
symlinks. (The problem I have does not occur on this server)


I googled lots of hours, but didn't find any thing useful.
I expected PHP to open the symlinked files as if they were actually
there.
Can I configure PHP to do so?

Reproduce code:
---------------
/var/export/db_mysql.inc:
require_once('dbsettings.inc');

/var/export/subdir/include.inc:
require_once('../menu.inc');

/var/www/app/menu.inc:
$menu = array( ... );

/var/www/app/dbsettings.inc:
$host = 'localhost';
$user = '...';
...

symlinks:
/var/www/app/db_mysql.inc -> /var/export/db_mysql.inc
/var/www/app/subdir -> /var/export/subdir

Expected result:
----------------
I expected PHP to open the symlinked files as if they were actually
there.


Actual result:
--------------
Warning: main(../menu.inc): failed to open stream: No such file or
directory in /var/export/subdir/include.inc on line 4

Fatal error: main(): Failed opening required '../menu.inc'
(include_path='/var/www/app') in /var/export/subdir/include.inc on line 4


-- 
Edit bug report at http://bugs.php.net/?id=33870&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33870&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33870&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33870&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33870&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33870&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33870&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33870&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33870&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33870&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33870&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33870&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33870&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33870&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33870&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33870&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33870&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33870&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33870&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33870&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33870&r=mysqlcfg

Reply via email to