I recently discovered that CGI scripts can be written in almost any language that can print to stdout. I wrote a little cgi script trick that works on my local apache installation, but not on my shared host:
#!/usr/local/bin/guile -s !# (display "Content-Type: text/html") (newline) (newline) (display "hi") (newline)
This is the output when I run the script from the shell on my host via ssh:
$ ./scheme.cgi Content-Type: text/html hi
So, obviously, my host is installed. However, when I try to access this file in the browser, I get a "500 Internal Server Error". When I look at my error logs, I see that I am getting a terrible "premature end error script":
[server.com] [Tue Aug 17 00:54:19 2010] [error] [client xx.xx.xx.xxx] (2)No such file or directory: exec of '/home/www/vhosts/jcw.geekisp.com/cgi-bin/scheme.cgi' failed [server.com] [Tue Aug 17 00:54:19 2010] [error] [client xx.xx.xx.xxx] Premature end of script headers: scheme.cgi
Since I'm on a shared host, using mod_lisp or a vile fastcgi implementation is out of the question. Say what could be here? Similar cgi scripts that I wrote in python, perl, ruby โโand sh work on the server without errors. I see that guile 1.8.7 is installed on the host, but my local computer is in the newest version.
I understand that this is an incredibly niche issue, any help would be appreciated!
scheme apache2 cgi guile
jcw
source share