Includes and sub-includes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yannick Turgeon

    Includes and sub-includes

    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
    authentificatio n (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('inclu de\authentifica tion\user.inc.p hp')"
    - login.php calls "include('..\us er.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


Working...