you could make includes absolute (although this is some work, it is recommended for bigger projects):
in every script, include a file that contains absolute paths, e.g. settings.inc.php:
<?
// settings file
$SETTINGS['BASE_PATH'] = '/home/myself/public_html/';
// yes, you could use constants as well ... I personally prefer this solution.
?>
now, in your scripts, include that file (respect the path individually)
// begin of my script
include_once "../settings.inc.php";
and now, use the absolute path stored in $_SETTINGS['BASE_PATH'] in front of every file reference (in your scripts, libraries etc: when using include, header relocations, file function calls etc.)
$data_file = $SETTINGS['BASE_PATH'].'data.xml';
include_once $SETTINGS['BASE_PATH'].'database_library.inc.php';