[gambit-list] gambit cgi error 11

Marc Feeley feeley at iro.umontreal.ca
Wed Jun 13 07:11:15 EDT 2007

Hash: SHA1

On 13-Jun-07, at 2:51 AM, |/|/ Bendick wrote:

> Hi, I'm trying to use gambit 4.0b22 for CGI but am having a problem. A
> simple script:
> #!/usr/local/Gambit-C/current/bin/gsi-script
> (define (main . args)
>         (display "Content-type: text/html\n\nhi\n\n")
>         (force-output (current-output-port))
>         0)
> But I get a "500 - Internal Server Error" every time I try to hit the
> page. The web server (lighttpd-1.4.15) tells me the script is exiting
> with a return value of 11 which the gambit manual doesn't document.
> The script runs fine from command line. If I just throw:
> #!/bin/sh
> echo "Content-type: text/html"
> echo ""
> echo "hi";
> into the file, it works correctly so it doesn't look like a
> permission/configuration/whatever error with the web server. Any ideas
> on code 11?

Do you know under what user the script is executed by lighttpd?  With  
Apache I've had similar problems where the user did not have the  
permission to execute gsi-script.

Small comments about your code: 1) you don't need the (current-output- 
port) argument to force-output because it is the default, 2) you  
don't need the force-output because that will be done for stdout when  
the process exits.  So the script could simply be:

(display "Content-type: text/html\n\nhi\n\n")


Version: GnuPG v1.4.3 (Darwin)


More information about the Gambit-list mailing list