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

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



mail

qmail にて検証。
postfix, sendmail については不明。。

server.php

<?php var_dump($_SERVER); ?>

.qmail-server

|/usr/local/bin/php /home/apache/htdocs/server.php > /tmp/server.txt

出力

% less /tmp/server.txt
array(28) {
  ["HOST2"]=>
  string(10) "example.com"
  ["HOST3"]=>
  string(7) "example"
  ["SENDER"]=>
  string(28) "hoge@example.com"
  ["RECIPIENT"]=>
  string(25) "server@example.com"
  ["HOST4"]=>
  string(3) ""
  ["DTLINE"]=>
  string(40) "Delivered-To: server@example.com
"
  ["HOST"]=>
  string(18) "example.com"
  ["EXT"]=>
  string(6) "server"
  ["USER"]=>
  string(5) "alias"
  ["LOCAL"]=>
  string(6) "server"
  ["PATH"]=>
  string(233) "/var/qmail/bin:/usr/local/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/kerberos/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/sbin:/usr/sbin:/var/qmail/bin:/sbin:/usr/sbin:/var/qmail/bin"
  ["RPLINE"]=>
  string(44) "Return-Path: <hoge@example.com>
"
  ["NEWSENDER"]=>
  string(28) "hoge@example.com"
  ["PWD"]=>
  string(16) "/var/qmail/alias"
  ["HOME"]=>
  string(16) "/var/qmail/alias"
  ["SHLVL"]=>
  string(1) "1"
  ["EXT3"]=>
  string(0) ""
  ["EXT2"]=>
  string(0) ""
  ["EXT4"]=>
  string(0) ""
  ["UFLINE"]=>
  string(59) "From hoge@example.com Tue Aug 21 02:32:42 2007
"
  ["_"]=>
  string(18) "/usr/local/bin/php"
  ["PHP_SELF"]=>
  string(34) "/home/apache/htdocs/server.php"
  ["SCRIPT_NAME"]=>
  string(34) "/home/apache/htdocs/server.php"
  ["SCRIPT_FILENAME"]=>
  string(34) "/home/apache/htdocs/server.php"
  ["PATH_TRANSLATED"]=>
  string(34) "/home/apache/htdocs/server.php"
  ["DOCUMENT_ROOT"]=>
  string(0) ""
  ["argv"]=>
  array(1) {
    [0]=>
    string(34) "/home/apache/htdocs/server.php"
  }
  ["argc"]=>
  int(1)
}



programming/php/etc/server/mail.txt