Is there a way to convert relative pathnames to absolute pathnames?
Relative to the current script,
realpath(dirname($SCRIPT_FILENAME).$relativepath);
Try that.