get server current directory php code example Example: php serverpath <?php echo $_SERVER['DOCUMENT_ROOT']; ?>