php nested include behavior

Posted by nute on Stack Overflow See other posts from Stack Overflow or by nute
Published on 2010-05-18T18:54:22Z Indexed on 2010/05/18 19:00 UTC
Read the original article Hit count: 546

Filed under:
|
|

In many places in my code, I do things like:

file1.php:
<?php
include('../file2.php');

file2.php:
<?php
include('anotherdirectory/file3.php');

Depending on the server or settings I try this on, it either sets the relative paths from the "includer" or from the "includee". This is really confusing. So file1 might try to include "../anotherdirectory/file3.php" or it might try "anotherdirectory/file3.php".

What settings dictate this behavior? I want to have control over this...

© Stack Overflow or respective owner

Related posts about php

Related posts about include