[an error occurred while processing this directive] [an error occurred while processing this directive]
This section defines both the standard Apache Environmental Variables and the extended SSI Variables. Click to display them for our server using the #printenv function or the neat and tidy PHP version.
Notes:
The names below are case sensitive.
These variables are initialised when the request arrives and is passed to the SSI handler.
If you need access to HTTP header variables then you need the services of mod_headers.
Since Apache is the most popular web server what it does has become the de facto standard in the industry. Almost all web servers provide all the variables listed below.
The revision of the CGI specification this server supports, example:
GATEWAY_INTERFACE=CGI/1.1
The PATH(s) available to the server for this web site, example:
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
The information (if any) following the "?" in the URL for this request, for example, myform.html?a=b&c=d would provide
QUERY_STRING=a=b&c=d
Among other uses this is the format that forms use with the POST method to send data to the server.
Note: CGI variables are not initialised before calling SSI - they are not separated into discrete entries. Instead, you must access them as a 'raw' string using the $QUERY_STRING variable, for instance, in the above example expr="${a} = 'b'" DOES NOT WORK but expr="${QUERY_STRING} = /a=b/" DOES WORK.
Notes about QUERY_STRING Limits: By default Apache allows a maximum QUERY_STRING length of 8190 bytes. This value can be modified in two ways. At compile time by setting the variable DEFAULT_LIMIT_REQUEST_FIELDSIZE when Apache is built. At run time by setting the httpd.conf directives LimitRequestFieldsize (default of 8190 or the value of DEFAULT_LIMIT_REQUEST_FIELDSIZE if different) or LimitRequestLine (default 8190 or the value of DEFAULT_LIMIT_REQUEST_FIELDSIZE if different). Obviously when using the latter two directives the value cannot be increased beyond 8190 unless the compile time variable has also been increased.
The IP address of the host making this request, example:
REMOTE_ADDR=207.35.76.27
The port number used by the remote host when making this request, example:
REMOTE_PORT=4325
The method used for this request for HTTP "GET", HEAD" or "POST", example:
REQUEST_METHOD=GET
The URI for this request (relative to DOCUMENT_ROOT), example:
REQUEST_URI=/tech/web/ssi.htm
The path to the script being executed (relative to DOCUMENT_ROOT), example:
SCRIPT_FILENAME=/tech/web/ssi.htm
The file name of the script being executed (relative to DOCUMENT_ROOT), example:
SCRIPT_NAME=/tech/web/ssi.htm
The IP address of the server for this URL, example:
SERVER_ADDR=207.35.76.24
The administrators e-mail address for this SERVER_NAME, example:
SERVER_ADMIN=webmaster@zytrax.com
The servers host name, DNS alias or IP address. For Apache the name appearing on the relevant ServerName directive (may be in the general section or a <virtualhost> section, example:
SERVER_NAME=www.zytrax.com
The port number on this server to which this request was directed, example:
SERVER_PORT=80
The name and revision of the protocol that delivered the current request, example:
SERVER_PROTOCOL=HTTP/1.1
The HTML string that may be embedded in the page to identify this host, example:
SERVER_SIGNATURE=<ADDRESS>Apache/1.3.14 Server at www.zytrax.com Port 80</ADDRESS>
The name and version of the information server answering the query, example:
SERVER_SOFTWARE=Apache/1.3.14 (Unix) (Red-Hat/Linux) PHP/4.0.3pl1
The following variables are constructed from the HTTP header information supplied by the requestor.
The MIME types the requestor will accept as defined in the HTTP header, example:
HTTP_ACCEPT=*/*
The MIME types the requestor will accept as defined in the HTTP header, example:
HTTP_ACCEPT_ENCODING=gzip, deflate
The LANGUAGE types the server is requested to accept as defined in the HTTP header and typically used for content negotiation, example:
HTTP_ACCEPT_LANGUAGE=en-us
The type of connection as defined in the HTTP header, example:
HTTP_CONNECTION=Keep-Alive
The value of any cookie in the HTTP header. Standard cookie formats are defined by RFC 2965 (Set-Cookie2 header) and the older (non-standard) netscape cookie format.
The base URL of the host, example:
HTTP_HOST=www.zytrax.com
The URL of the page that made this request. If linked from e-mail or manually entered this value is NULL.
HTTP_REFERER=http://www.zytrax.com/tech/web/
The browser id or user-agent string identifying the browser (nominally defined by RFC 1945 and RFC 2068). See here for our current list.
HTTP_USER_AGENT=Mozilla/4.0 (compatible; MSIE 5.0; Windows NT; DigExt)
This section defines the additional variables made available by SSI.
The current date and time in Greenwich Mean Time (now Unviversal Co-ordinated Time (UCT) in the default or #config defined format).
DATE_GMT=Thursday, 03-May-2001 21:18:54 GMT
The current date and time in the local (server) timezone (in the default or #config defined format).
DATE_LOCAL=Thursday, 03-May-2001 17:18:54 EDT
The root directory of this site defined by the 'DocumentRoot' directive in the General Section or a <virtualhost> section, example:
DOCUMENT_ROOT=/var/www/zytrax
The file name (excludes directories) of the document requested by the user, example:
DOCUMENT_NAME=ssi.htm
Not well documented, but it seems that if there is query string information following the URL (starts with a '?'), for instance, ../index.html?x=a, the data (x=a) is placed in QUERY_STRING. If the additional data starts with a /, for instance, ../index.html/path?x=a the data (path?x=a) is placed in the DOCUMENT_INFO_PATH variable. Apache 2.x allows the behaviour to be controlled using the AcceptPathInfo directive
DOCUMENT_PATH_INFO=
The URL path of the document requested by the user, example:
DOCUMENT_URI=/tech/web/ssi.htm
The last modification date of the document (file) requested by the user (in the default or #config defined format). This variable is not changed for SSI included files.
LAST_MODIFIED=Thursday, 03-May-2001 17:18:45 EDT
The user name of the web site in which this web site runs, example:
USER_NAME=zytrax[an error occurred while processing this directive]