<?php var_export($_SERVER) ?>
と書いて適当なPHPファイルとして保存してブラウザで開くと、
array ( 'USER' => 'nginx', 'HOME' => '/var/lib/nginx', 'FCGI_ROLE' => 'RESPONDER', 'SCRIPT_FILENAME' => '/var/www/html/phptest.php', 'QUERY_STRING' => '', 'REQUEST_METHOD' => 'GET', 'CONTENT_TYPE' => '', 'CONTENT_LENGTH' => '', 'SCRIPT_NAME' => '/phptest.php', 'REQUEST_URI' => '/phptest.php', 'DOCUMENT_URI' => '/phptest.php', 'DOCUMENT_ROOT' => '/var/www/html', 'SERVER_PROTOCOL' => 'HTTP/1.1', 'GATEWAY_INTERFACE' => 'CGI/1.1', 'SERVER_SOFTWARE' => 'nginx/1.8.1', 'REMOTE_ADDR' => '118.243.235.67', 'REMOTE_PORT' => '51627', 'SERVER_ADDR' => '172.30.2.158', 'SERVER_PORT' => '80', 'SERVER_NAME' => 'localhost', 'REDIRECT_STATUS' => '200', 'HTTP_HOST' => '54.64.47.96', 'HTTP_CONNECTION' => 'keep-alive', 'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'HTTP_UPGRADE_INSECURE_REQUESTS' => '1', 'HTTP_USER_AGENT' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36', 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate, sdch', 'HTTP_ACCEPT_LANGUAGE' => 'ja,en-US;q=0.8,en;q=0.6', 'PHP_SELF' => '/phptest.php', 'REQUEST_TIME_FLOAT' => 1456902227.0044191, 'REQUEST_TIME' => 1456902227, )
というように見にくく表示される。 DOCUMENT_ROOTと書いてあるところから、document rootを確認できる。