Well, it required the environment variable "REQUEST_METHOD" to be set; it did a string compare on it, and this crashed on a NULL pointer, which was what getenv() returned when the requested variable did not exist. It was resistent against the query string not existing, (replacing it by an empty string), and the program was written such that in this case it showed a King image.
I modified it to assume the GET method by default. This made things work: when I run public_html/cgi-bin/fen2.cgi from the command line of PuTTy, it responds with "Content-type: image/png", followed by a lot of non-ascii, which I suppose is the png image.
Accessed through the web interface it still gives me the error message "Internal Server Error", though. So I suspect there is still something wrong with the server settings.
[Edit] .html files in cgi-bin can be retrieved, and .php scripts there do work. Other .cgi files there give the same error message. and an attempt to retrieve a .txt file too. My guess is that Apache should still be told that running CGI files from this directory is OK.
Well, it required the environment variable "REQUEST_METHOD" to be set; it did a string compare on it, and this crashed on a NULL pointer, which was what getenv() returned when the requested variable did not exist. It was resistent against the query string not existing, (replacing it by an empty string), and the program was written such that in this case it showed a King image.
I modified it to assume the GET method by default. This made things work: when I run public_html/cgi-bin/fen2.cgi from the command line of PuTTy, it responds with "Content-type: image/png", followed by a lot of non-ascii, which I suppose is the png image.
Accessed through the web interface it still gives me the error message "Internal Server Error", though. So I suspect there is still something wrong with the server settings.
[Edit] .html files in cgi-bin can be retrieved, and .php scripts there do work. Other .cgi files there give the same error message. and an attempt to retrieve a .txt file too. My guess is that Apache should still be told that running CGI files from this directory is OK.