Here\'s a problem that I\'ve been running into lately - a misconfigured apache on a webhost. This means that all scripts that rely on $_SERVER[\'DOCUMENT_ROOT\']
In PHP5 there is the magic constant __FILE__ that contains the absolute path of the file in which it appears. You can use it in combination with dirname to calculate the document root.
You can put a statement like the following one in a config file
define ('DOCUMENT_ROOT', dirname(__FILE__));
this should do the trick