Hi,
I have /a.php, /dir1/b.php, /dir1/c.php. a.php does include("dir1/b.php") and b.php does include("c.php"). Retrieving http://server/a.php shows that c.php cannot be found. I understand this is the normal behavior, from what I read from the include documentation.
My question is this: What do I have to change in php.ini or elsewhere to make this code work without changing the code or moving the files? Or maybe there is an extension/module that alters this behavior? I read the include documentation and I searched on a few forums but could not find an answer.
Thanks!
include a file from a file in a subdirectory
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: include a file from a file in a subdirectory
It looks like your include_path setting in php.ini does not contain the '.' (current) directory.
(#10850)
Re: include a file from a file in a subdirectory
It does include ".", but the current directory is "/".arborint wrote:It looks like your include_path setting in php.ini does not contain the '.' (current) directory.
Is there a way to automatically change the current directory when including a file which is in a different directory?
Or is there a way to alter the include behavior to check first the files in the same directory when the path is not absolute?