Hi guys,
I'm having a problem installing a PHP app and I think I've narrowed it down to a problem with the way require() is being handled on my Windows 2003 box. I've read the manual entry here and from what I understand, a file that is included with require() will take on the context of the parent file:
http://us2.php.net/manual/en/function.include.php
To test my theory, I have 3 files with the following structure
/a.php
/test/b.php
/test/c.php
File A looks like this:
echo('File A<br/>');
require('test/b.php");
File B looks like this:
echo('File B<br/>');
require("test/c.php");
and File C looks like this:
echo('File C<br/>');
My understanding is this should work - File B should have the context of File A so the require for File C will be executed from the root (not the /test/ subdir). Unfortunately it doesn't work!
I get the following output:
File A
File B
Warning: main(test/c.php): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\test\b.php on line 5
Fatal error: main(): Failed opening required 'test/c.php' (include_path='.') in C:\Inetpub\wwwroot\test\b.php on line 5
Is this the expected behaviour or is there some sort of configuration option that I'm missing? If I run the same files under OS X I get the expected response with no errors.
P.