Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are all the standard CGI environment variables?

CGI scripts should have access to a list of environment variables set by the web server. What are their names?

like image 950
joeforker Avatar asked Dec 17 '22 01:12

joeforker


1 Answers

See RFC 3875 for the CGI spec, which has all the info you need. :-)

From the RFC:

  meta-variable-name = "AUTH_TYPE" | "CONTENT_LENGTH" |
                       "CONTENT_TYPE" | "GATEWAY_INTERFACE" |
                       "PATH_INFO" | "PATH_TRANSLATED" |
                       "QUERY_STRING" | "REMOTE_ADDR" |
                       "REMOTE_HOST" | "REMOTE_IDENT" |
                       "REMOTE_USER" | "REQUEST_METHOD" |
                       "SCRIPT_NAME" | "SERVER_NAME" |
                       "SERVER_PORT" | "SERVER_PROTOCOL" |
                       "SERVER_SOFTWARE" | scheme |
                       protocol-var-name | extension-var-name
  protocol-var-name  = ( protocol | scheme ) "_" var-name
  scheme             = alpha *( alpha | digit | "+" | "-" | "." )
  var-name           = token
  extension-var-name = token
like image 187
Chris Jester-Young Avatar answered Jan 06 '23 13:01

Chris Jester-Young