By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,007 Members | 1,058 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,007 IT Pros & Developers. It's quick & easy.

Includes and sub-includes

P: n/a
Hello all,

We are currently changing our web server and, in the process, updating PHP
version from 4.3.0 to 4.3.5. The problem we've got is that our way to
include some files in other ones is no more working properly. The message we
are getting looks like: "PHP Warning: main(..\db.inc.php): failed to open
stream: No such file or directory in ..."

Say we have this file structure:

myApplication (dir)
index.php
include (dir)
db.inc.php
authentification (dir)
user.inc.php
login.php
- user.inc.php includes db.inc.php calling "include('..\db.inc.php')"
- both login.php and index.php includes user.inc.php
- index.php calls "include('include\authentification\user.inc.ph p')"
- login.php calls "include('..\user.inc.php')"

I know I could solve this problem by making those the includes absolute
instead of relative but I would prefer to let it relative for some
developement reason. myApplication actually contains many other files
calling "include('..\db.inc.php')" so I don't want to move this file.

Our old configuration seems to include child-includes in their parents
before including the parent-include in the main file. Now it seems to
include parent before include childs.

Any one has an idea why it's no more working and what I could do solve this?

Yannick
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.