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

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



cli

server.php

<?php var_dump($_SERVER); ?>

コマンド実行

% superman@cocos% php server.php

出力

array(43) {
  ["STY"]=>
  string(15) "16952.pts-0.dev"
  ["TERM"]=>
  string(6) "screen"
  ["TERMCAP"]=>
  string(1373) "SC|screen|VT 100/ANSI X3.64 virtual terminal:\\
	:DO=\\E[%dB:LE=\\E[%dD:RI=\\E[%dC:UP=\\E[%dA:bs:bt=\\E[Z:\\
	: ~ 略 ~
	:kI=\\E[2~:kD=\\E[3~:ku=\\EOA:kd=\\EOB:kr=\\EOC:kl=\\EOD:km:"
  ["WINDOW"]=>
  string(1) "0"
  ["SHELL"]=>
  string(8) "/bin/zsh"
  ["USER"]=>
  string(7) "superman"
  ["LOGNAME"]=>
  string(7) "superman"
  ["HOME"]=>
  string(13) "/home/superman"
  ["PATH"]=>
  string(160) "/home/superman/bin:/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin"
  ["MAIL"]=>
  string(23) "/var/spool/mail/superman"
  ["SSH_CLIENT"]=>
  string(21) "192.168.0.1 61983 22"
  ["SSH_CONNECTION"]=>
  string(37) "192.168.0.1 61983 192.168.9.9 22"
  ["SSH_TTY"]=>
  string(10) "/dev/pts/0"
  ["SSH_AUTH_SOCK"]=>
  string(28) "/home/superman/.ssh/***"
  ["SHLVL"]=>
  string(1) "1"
  ["PWD"]=>
  string(23) "/home/apache/htdocs"
  ["OLDPWD"]=>
  string(13) "/home/superman"
  ["HOSTNAME"]=>
  string(10) "example.com"
  ["HISTSIZE"]=>
  string(4) "1000"
  ["INPUTRC"]=>
  string(12) "/etc/inputrc"
  ["LS_COLORS"]=>
  string(440) "no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=01;32:"
  ["G_BROKEN_FILENAMES"]=>
  string(1) "1"
  ["LANG"]=>
  string(1) "C"
  ["LESSOPEN"]=>
  string(24) "|/usr/bin/lesspipe.sh %s"
  ["_"]=>
  string(18) "/usr/local/bin/php"
  ["LC_ALL"]=>
  string(1) "C"
  ["HISTFILE"]=>
  string(27) "/home/superman/.bash_history"
  ["SAVEHIST"]=>
  string(4) "1000"
  ["PAGER"]=>
  string(4) "less"
  ["EDITOR"]=>
  string(2) "vi"
  ["PHP_SELF"]=>
  string(10) "server.php"
  ["SCRIPT_NAME"]=>
  string(10) "server.php"
  ["SCRIPT_FILENAME"]=>
  string(10) "server.php"
  ["PATH_TRANSLATED"]=>
  string(10) "server.php"
  ["DOCUMENT_ROOT"]=>
  string(0) ""
  ["argv"]=>
  array(1) {
    [0]=>
    string(10) "server.php"
  }
  ["argc"]=>
  int(1)
}



programming/php/etc/server/cli.txt