I slightly remember from age old PHP days (years ago) that different functions wanted to have different paths. I mean…starting from different points. Some were relative, others absolute, etc.
How about fopen? Is that the same thing like require? Same path in same situation?
Paths are always relative to the initial script’s location, even if the parser is going through an include that resides in a different directory.
To reliably work with paths relative to the current file, use
or in PHP 5
in addition, as @troelskn points out below,
requireandincludesearch the include_path.