---
name: "fcgiwrap"
section: "8"
platform: "linux"
package: "fcgiwrap"
version: "1.1.0-10"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/fcgiwrap"
---

# fcgiwrap(8)

serve CGI applications over FastCGI

## NAME

fcgiwrap - serve CGI applications over FastCGI

## SYNOPSIS

**fcgiwrap** *\[OPTIONS\]*

## DESCRIPTION

**fcgiwrap** is a simple server for running CGI applications over FastCGI. It hopes to provide clean CGI support to Nginx (and other web servers that may need it).

## OPTIONS

- **-c *number***

  Number of fcgiwrap processes to prefork.

- **-f**

  Redirect STDERR output from executed CGI through FastCGI so it shows in the web server error log.  Otherwise it would be returned on **fcgiwrap**'s STDERR, which could be redirected. If running through **spawn-fcgi**, **fcgiwrap**'s STDERR is sent to /dev/null, so this option provides a way to get that output back.

- **-s *socket\_url***

  A URL for the listen socket to bind to. By default **fcgiwrap** expects a listen socket to be passed on file descriptor 0, matching the FastCGI convention. The recommended way to deploy **fcgiwrap** is to run it under a process manager that takes care of opening the socket. However, for simple configurations and one-off tests this option may be used. Valid socket\_urls include *unix:/path/to/unix/socket*, *tcp:dot.ted.qu.ad:port* and *tcp6:\[ipv6\_addr\]:port*.

- **-h**

  Show a help message and exit.

## ENVIRONMENT

When running, **fcgiwrap** evaluates these environment variables set by the web server calling an fcgi-script. The variables DOCUMENT\_ROOT and SCRIPT\_NAME will be concatenated and the resulting executable run as CGI script wrapped as FastCGI, with the remainder after the script name available as PATH\_INFO. To disable PATH\_INFO mangling, set up your web server to pass SCRIPT\_FILENAME, which should contain the complete path to the script. Then PATH\_INFO will not be modified.

DOCUMENT\_ROOT

directory which the script resides in

SCRIPT\_NAME

actual executable

SCRIPT\_FILENAME

complete path to CGI script. When set, overrides DOCUMENT\_ROOT and SCRIPT\_NAME

## EXAMPLE

The fastest way to see **fcgiwrap** do something is to launch it at the command line like this:\
 fcgiwrap -s unix:/var/run/fcgiwrap.sock\
 Apart from potential permission problems etc., it should be ready to accept FastCGI requests and run CGI scripts.

Most probably you will want to launch **fcgiwrap** by  *spawn-fcgi* using a configuration like this:

FCGI\_SOCKET=/var/run/fcgiwrap.sock\
 FCGI\_PROGRAM=/usr/sbin/fcgiwrap\
 FCGI\_USER=nginx\
 FCGI\_GROUP=www\
 FCGI\_EXTRA\_OPTIONS="-M 0700"\
 ALLOWED\_ENV="PATH"

*Nginx* can be configured to have the arbitrary CGI *cgit* run as FastCGI as follows:

location / {\
\
 	fastcgi\_param DOCUMENT\_ROOT /var/www/localhost/htdocs/cgit/;\
\
 	fastcgi\_param SCRIPT\_NAME   cgit;\
\
 	fastcgi\_pass unix:/var/run/fastcgi.sock;\
 }

## AUTHOR

fcgiwrap was written by Grzegorz Nosek \<root@localdomain.pl\> with contributions by W-Mark Kubacki \<wmark@hurrikane.de\>.

This manual page was written by Jordi Mallach \<jordi@debian.org\> (with contributions by Grzegorz Nosek) for the Debian project (and may be used by others).
