|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-07-26 17:51 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 05:00:01 2026 UTC |
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