1

http://code.google.com/p/mongoose/
http://shttpd.sourceforge.net/shttpd.1.txt

Trying to configure the lightweight web server shttpd now called mongoose to execute CGI scripts in C.

Does it need a seperate CGI interpreter for C?

A download of shttpd on source forge had separate interpreter exe for perl and php cgi but not sure if that means I need one in C...

mpromonet
  • 11,326
  • 43
  • 62
  • 91
T.T.T.
  • 33,367
  • 47
  • 130
  • 168

3 Answers3

3

Actually, with tiny C compiler (http://bellard.org/tcc/) it is very possible to run .c files as scripts. Just add #!/usr/local/bin/tcc -run at the first line of your C source.

valenok
  • 827
  • 7
  • 9
2

I assume, your CGI executable is a binary executable. If you're on UNIX, rename your CGI executable to have '.cgi' extension. If you're on Windows, and CGI executable has '.exe' extension, specify server option "-cgi_ext exe"

  • thank you. I had implemented this web server in C (cocoa, actually), very simply, and was angry it wasn't running the cgi's like it had when running by itself. just adding .cgi is a small price to pay to make it just work. – Alex Gray Sep 02 '11 at 06:32
1

C is not interpreted - you need to compile your CGI program before it can be run. And for any specific Mongoose questions, you may want to use the support group at http://groups.google.com/group/mongoose-users/topics