I usually create a map file which points to every shared file I use. The only thing you need to define then is the path to the document root. In my PHP files I refer to scripts via the map file, e.g.
$env = loadConfig(); // Load the map file into $env
include($env['scriptpath']."/".$en['scriptname']); // Include a file using the map file
Then you can move your work onto new machines fairly painlessly.