Hi all. I ran into a strange problem with nested require statements and how directory positions are parsed when I moved my code from one host to another. I am wondering what I should do about it...
In /index.php, I have a call:
require "common/prpsql.php";
Which works fine. In common/prpsql.php, I have another call:
require "common/browse.php";
This works fine on two hosts (linux/apache/php4 and XPPro/apache/php4), but not on another (WinNT/MS-IIS/php4).
On the "broken" host, it seems that php interprets the call in prpsql.php as originating in the common/ directory, and cannot find /common/common/browse.php. On the "unbroken" hosts, the source location is interpreted as / since that's where the starting file (index.php) is, no matter how many nested require statements there are. What's going on? Why is the behavior different? And what's the right way to handle this (include_path?)?