I have tested the unmodified example (Ubuntu/13.10/amd-64, Apache/2.4.6, libapache2-mod-fastcgi/2.4.7~0910052141-1.1, libfcgi-dev/2.4.0-8.1ubuntu4) and it runs ok:
manuelz@garibaldi:~$ curl habrich/tiny-fcgi
<title>FastCGI Hello! (C, fcgi_stdio library)</title>
<h1>FastCGI Hello! (C, fcgi_stdio library)</h1>
Request number 2 running on host <i>habrich</i>
Answers:
- Hard to tell without knowing your configuration, but here's a shot in the dark:
getenv
will returnNULL
ifSERVER_NAME
is undefined. fcgiapp
is the base implementation: I would use that one for new development.fcgi_stdio
is a wrapper for compatibility with CGI: use that for migrating legacy CGI projects. Quote:fcgi_stdio is implemented as a thin layer on top of fcgiapp
fcgiapp
in the fcgiapp.h header.