[gambit-list] gambit cgi error 11

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


-----BEGIN PGP SIGNED MESSAGE-----
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:

#!/usr/local/Gambit-C/current/bin/gsi-script
(display "Content-type: text/html\n\nhi\n\n")


Marc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFGb9DU//V9Zc2T/v4RAtfmAKCXJhaxGaffzOl2iN/vplAj69LfewCgjBH7
nhmMEmCh+6reGCDIAJx6fFw=
=N/TH
-----END PGP SIGNATURE-----



More information about the Gambit-list mailing list