Create and place this file in your document root, include it in all other files to easily have access to the directory your site is located without using clumsy and unreliable $_SERVER or $_ENV entries.
_require.php:
<?php
$oldCwd = getcwd();
chdir(dirname(__FILE__));
define('SITE_DOCROOT', getcwd());
chdir($oldCwd);
?>
Related posts:
WP Cumulus Flash tag cloud by Roy Tanck and Luke Morton requires Flash Player 9 or better.