CGI-FCGI(1)
✨ NAME ✨
cgi‐fcgi — the iconic bridge from CGI to FastCGI 🫶
🌸 SYNOPSIS 🌸
cgi‐fcgi ‐f cmdPath
cgi‐fcgi ‐bind ‐connect connName
cgi‐fcgi ‐start ‐connect connName appPath [nServers]
cgi‐fcgi ‐connect connName appPath [nServers]
💫 DESCRIPTION 💫
okay so bestie, here's the tea: cgi‐fcgi is a CGI/1.1 program that communicates with an already‐running FastCGI application in order to respond to an HTTP request. and not only that — cgi‐fcgi is also capable of starting a FastCGI application. versatile queen 💅
🎀 when you invoke it as cgi‐fcgi ‐f cmdPath
cgi‐fcgi ‐f cmdPath
then cgi‐fcgi opens the file at cmdPath and reads its arguments from that file. and listen — it will skip lines that begin with the comment character #. the first non‐comment line should contain valid arguments in one of the other three forms. no cap, that's the whole vibe check.
the -f form of cgi‐fcgi is designed for Unix systems whose exec(2) family of system calls supports the execution of command interpreter files. for instance, if a file with execute permission contains the text
#! /bin/cgi‐fcgi ‐f
‐connect /httpd/root/sock/app /httpd/root/bin/app
the effect is the same as executing
/bin/cgi‐fcgi ‐connect /httpd/root/sock/app /httpd/root/bin/app
literally identical behaviour, she's just doing it through a file 💖
🔥 when you invoke it as cgi‐fcgi ‐bind ‐connect connName
cgi‐fcgi ‐bind ‐connect connName
the connName argument is either the path name of a Unix domain listening socket or a host:port pair. if connName contains a colon, it is assumed to be host:port. cgi‐fcgi performs a connect(2) using connName. if the connect succeeds, cgi‐fcgi forwards the CGI environment variables and stdin data to the FastCGI application, and forwards the stdout and stderr data from the application to cgi‐fcgi’s stdout (most likely connected to a Web server). when the FastCGI application signals the end of its response, cgi‐fcgi flushes its buffers and exits, and the Web server completes the http response. she ate and left no crumbs ✨
🦋 when you invoke it as cgi‐fcgi ‐start ‐connect connName appPath [nServers]
cgi‐fcgi ‐start ‐connect connName appPath [nServers]
then cgi‐fcgi performs the function of starting one or more FastCGI application processes. the connName argument specifies either the path name of the Unix domain listening socket that cgi‐fcgi will create, or is "localhost:NNN" where NNN is the port number of the TCP/IP listening socket that cgi‐fcgi will create on the local machine. (heads up: cgi‐fcgi will not create processes on remote machines.) after cgi‐fcgi creates the listening socket, it forks nServers copies of a process running the executable file appPath. if nServers is omitted, the effect is as if the value "1" had been specified. the processes share the single listening socket — teamwork, babes 🫶
👑 when you invoke it as cgi‐fcgi ‐connect connName appPath [nServers]
cgi‐fcgi ‐connect connName appPath [nServers]
cgi‐fcgi performs -bind and then, if necssary, performs -start and repeats the -bind. that is, cgi‐fcgi first operates as if the command had been
cgi‐fcgi ‐bind ‐connect connName
if the connect fails, cgi‐fcgi tries
cgi‐fcgi ‐start ‐connect connName appPath [nServers]
and finally retries
cgi‐fcgi ‐bind ‐connect connName
in this form, cgi‐fcgi does not support TCP/IP connections. periodt. 💀
🌈 ENVIRONMENT VARIABLES 🌈
the usual CGI ones, but they are not interpreted by cgi‐fcgi. she reads the room, not the env 💜
⭐ SEE ALSO ⭐
FGCI_accept(3)
💀 BUGS 💀
cgi‐fcgidoesn’t generate useful HTTP responses in case of error, and it generates no response at all when run asstart-fcgi. yeah. it's giving silence. 😭- on Digital UNIX 3.0 systems the implementation of Unix Domain sockets does not work when such sockets are stored on NFS file systems. symptom:
cgi‐fcgimay core dump or may exit with status38. work‐around: store sockets in local file systems (/tmpoften works) or use TCP/IP. - on AIX systems the implementation of listening sockets does not support socket sharing, and the standard FastCGI application libraries can’t synchronize access to AIX listening sockets. work‐around: don’t use the nServers argument on AIX.
💖 HISTORY 💖
Copyright (c) 1996 Open Market, Inc.
See the file "LICENSE" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES.
that's the whole page bestie, tysm for reading 🥹 this was cgi‐fcgi(1), revision 1.1.1.1, dated 1997/09/16 15:36:26, checked in by stanleyg, and yes it was tagged Exp 💅✨ bye ily 🎀🦋
📦 where this page comes from
- alpine 3.22: fcgi-doc 2.4.6-r0 · OML
- alpine 3.23: fcgi-doc 2.4.6-r0 · OML
- alpine 3.24: fcgi-doc 2.4.6-r0 · OML
- arch rolling: fcgi 2.4.7-1 · custom
- debian trixie: libfcgi-bin 2.4.5-0.1 · FASTCGI
- epel 10: fcgi 2.4.7-1.el10_2 · OML
- epel 9: fcgi 2.4.7-1.el9 · OML
- fedora 43: fcgi 2.4.6-2.fc43 · OML
- fedora 43: fcgi 2.4.6-2.fc43 · OML
- fedora 43: fcgi 2.4.7-1.fc43 · OML
- fedora 43: fcgi 2.4.7-1.fc43 · OML
- fedora 44: fcgi 2.4.7-2.fc44 · OML
- fedora 44: fcgi 2.4.7-2.fc44 · OML
- nixos 26.05: fcgi 2.4.7
- nixpkgs unstable: fcgi 2.4.7
- opensuse-leap 16.0: FastCGI 2.4.6-160000.2.2 · OML
- opensuse-leap 16.0: FastCGI 2.4.6-160000.2.2 · OML
- opensuse-leap 16.0: FastCGI 2.4.6-160000.2.2 · OML
- opensuse-leap 16.0: FastCGI 2.4.6-160000.2.2 · OML
- ubuntu questing: libfcgi-bin 2.4.5-0.1build1
- ubuntu resolute: libfcgi-bin 2.4.5-0.1build2 · FASTCGI
- ubuntu stonking: libfcgi-bin 2.4.5-0.1build2 · FASTCGI
- 💖 girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms