̃Gg[͂ĂȃubN}[Nɒlj

PHP :: スーパーグローバル変数 $_SERVER を var_dump してみる



apache

server.php

<?php var_dump($_SERVER); ?>

ブラウザからアクセス

http://example.com/server.php

出力

array(28) {
  ["DOCUMENT_ROOT"]=>
  string(23) "/home/apache/htdocs"
  ["HTTP_ACCEPT"]=>
  string(164) "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*"
  ["HTTP_ACCEPT_ENCODING"]=>
  string(13) "gzip, deflate"
  ["HTTP_ACCEPT_LANGUAGE"]=>
  string(2) "ja"
  ["HTTP_CONNECTION"]=>
  string(10) "Keep-Alive"
  ["HTTP_HOST"]=>
  string(12) "example.com"
  ["HTTP_UA_CPU"]=>
  string(3) "x86"
  ["HTTP_USER_AGENT"]=>
  string(103) "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.2; .NET CLR 2.0.5)"
  ["PATH"]=>
  string(84) "/command:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin"
  ["REMOTE_ADDR"]=>
  string(12) "192.168.0.1"
  ["REMOTE_PORT"]=>
  string(5) "63552"
  ["SCRIPT_FILENAME"]=>
  string(34) "/home/apache/htdocs/server.php"
  ["SERVER_ADDR"]=>
  string(15) "192.168.9.9"
  ["SERVER_ADMIN"]=>
  string(18) "webmaster@example.com"
  ["SERVER_NAME"]=>
  string(12) "example.com"
  ["SERVER_PORT"]=>
  string(2) "80"
  ["SERVER_SIGNATURE"]=>
  string(64) "<ADDRESS>Apache/1.3.36 Server at example.com Port 80</ADDRESS>
"
  ["SERVER_SOFTWARE"]=>
  string(30) "Apache/1.3.36 (Unix) PHP/4.4.2"
  ["GATEWAY_INTERFACE"]=>
  string(7) "CGI/1.1"
  ["SERVER_PROTOCOL"]=>
  string(8) "HTTP/1.1"
  ["REQUEST_METHOD"]=>
  string(3) "GET"
  ["QUERY_STRING"]=>
  string(0) ""
  ["REQUEST_URI"]=>
  string(11) "/server.php"
  ["SCRIPT_NAME"]=>
  string(11) "/server.php"
  ["PATH_TRANSLATED"]=>
  string(34) "/home/apache/htdocs/server.php"
  ["PHP_SELF"]=>
  string(11) "/server.php"
  ["argv"]=>
  array(0) {
  }
  ["argc"]=>
  int(0)
}



programming/php/etc/server/apache.txt