---
name: "mapserv"
section: "1"
platform: "linux"
package: "mapserver-bin"
version: "8.4.0-4+deb13u2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/mapserv"
---

# mapserv(1)

mapserver CGI interface

## NAME

mapserv - mapserver CGI interface

## SYNOPSIS

FC**mapserv**F\[0\]  \[FC**-v**F\[0\] \|  \[FC**-nh**F\[0\]\] QUERY\_STRING=" *QUERY\_STRING*" \]

## DESCRIPTION

**mapserv** provides commandline access to the MapServer CGI interface.

## OPTIONS

- FC**-v**F\[0\]

  Display mapserver version and build options.

- FC**-nh**F\[0\]

  Suppress HTTP headers.

- FC**QUERY\_STRING**F\[0\]="*QUERY\_STRING*"

  CGI QUERY\_STRING parameter, e.g.  QUERY\_STRING="MAP=/home/user/wfs.map&SERVICE=WFS&REQUEST=GetCapabilities"

## EXAMPLE

The CGI interface can be tested at the commandline by using the "QUERY\_STRING" switch, such as:

```
FC
       mapserv "QUERY_STRING=map=/home/user/wms.map&mode=map"
      F[0]
```

To suppress the HTTP headers, you can use the "FC**-nh**F\[0\]" switch, such as:

```
FC
       mapserv -nh "QUERY_STRING=map=/home/user/wms.map&mode=map"
      F[0]
```

To save the output into an image file, use the pipe command such as:

```
FC
       mapserv -nh "QUERY_STRING=map=/home/user/wms.map&mode=map" > test.png
      F[0]
```

## SEE ALSO

         MapServer CGI Documentation        ⟨http://mapserver.org/cgi/index.html⟩
