CGI Environment Variables

by Jeff Hunter, Sr. Database Administrator


Introduction

The following environment variables are defined by the current Common Gateway Interface standard.

All other request headers are supplied as environment variables with the prefix HTTP_ and all hyphens replaced by an underscore. Headers that have already been included (e.g., Content-length) may be omitted.

CGI Environment Variables

CGI Environment Variables
Variable Function
SERVER_SOFTWARE Identifies the server software
SERVER_NAME Identifies server address
GATEWAY_INTERFACE Identifies the CGI version in use
SERVER_PROTOCOL Specifies the request protocol
SERVER_PORT Specifies the server port
REQUEST_METHOD Specifies the request method
PATH_INFO Specifies the request path info
PATH_TRANSLATED Specifies the translated request path info
SCRIPT_NAME Specifies the script's virtual path
QUERY_STRING Specifies the request query string
REMOTE_HOST Specifies the remote hostname
REMOTE_ADDR Specifies the remote IP address
AUTH_TYPE Specifies user authentication method
REMOTE_USER Specifies the remote user, if authenticated
REMOTE_IDENT Specifies the remote username if determined (RFC 931)
CONTENT_TYPE Specifies the request content type
CONTENT_LENGTH Specifies the request content length



Last modified on: Saturday, 18-Sep-2010 18:04:56 EDT
Page Count: 2042