Here's what I do on all my php files.
if (!defined(FILE)) {
define(FILE, 1);
$docRoot = $_SERVER["DOCUMENT_ROOT"];
require_once($docRoot . "/myInclude1.php");
require_once($docRoot . "/myInclude2.php");
// ... more php code ...
}
I avoid reentrancy problems by checking to see if FILE has been defined. If it hasn't I define it.
I use $_SERVER["DOCUMENT_ROOT"] to retrieve the physical path of the webserver's document root. On Microsoft IIS systems this is InetPub by default. On Apache systems this is htdocs.
I then require_once forming the full absolute path from document root to the file to be included. If you ever programmed in C/C++ before you will appreciate PHPs ability to form include file paths at runtime.
Thus, everything is based on the document root. If I move the file to another directory, then I simply update the require_once paths from inside the file being moved.