nph-srep environment variablesΒΆ

The Common Gateway Interface (CGI) defines the use of environment variables as a means to comunicate cgi programs (like nph-srep) with web servers. For more information see the IETF CGI version 1.1 memo (external link).

The getenv() function could be used from nph-srep to get the value of any environment variables shared by web servers (CGI ones included). Internally nph-srep makes use of these CGI variables (the meaning may vary depending on the web server used):

CGI variables

CONTENT_LENGTH

CONTENT_TYPE

HTTP_COOKIE

QUERY_STRING

PATH_INFO

PATH_TRANSLATED

REMOTE_ADDR

REMOTE_USER

REQUEST_METHOD

SCRIPT_FILENAME

SCRIPT_NAME

SERVER_PROTOCOL

SERVER_SOFTWARE

Several other environment variables have to be configured in order for nph-srep to work. It may depend on many factors (OS, web server and type of setup/mapping needed) the exact environment variables to use, refer to the web server setup tutorials to learn which environment variables are needed and the way to set them up. These are the possible values:

Environment variable

Description

LANG 1

To setup the locale in nph-srep afecting the output format where needed and it is also used when dealing with character code transformation between utf-8 (used on the web output) and the local encoding (specified by the LANG variable).

SCULPTOR 1

As most of the Sculptor programs nph-srep needs this variable to be specified.

SC_CHDIR 1

When due the web server configuration the nph-srep execution starts in the wrong directory this variable can be used to specify a directory to change previous the report program execution.

1(1,2,3)

Since Sculptor version 6.2.0 SC_CHDIR, SCULPTOR and LANG can also be specified with an HTTP_ prefix (HTTP_SC_CHDIR, HTTP_SCULPTOR and HTTP_LANG) so that nph-srep may work with the apache suexec module that filters normal environment variables while not the ones starting with HTTP_.


RELATED TOPICS

Creating web pages with Sculptor

nph-srep

Web Services REST

getenv()

Sculptor environment variables