Hello, I am trying to use CGI scripts on my static host. We are getting a 500 error on the page, and when I check the logs it's a "premature end of script header" error, but I am fairly certain it is unrelated to the file permissions as I have set it to 711. Everything seems to be set up correctly because a simple "hello world" CGI script does work okay. Here is the code, any help/advice would be much appreciated:
asked 18 Oct '11, 18:24 dmur |
Your CGI script looks correct. One common source of error which would produce the 500 error (generally a If you are using DOS line endings, or Mac line endings, you can convert the script from within SSH using the commands:
Alternatively, when writing your script on another operating system and uploading it to the server via FTP, you can simply choose to use a unix-aware text editor and choose to save the file with Unix line endings. Hope that helps! answered 18 Oct '11, 19:16 ryans ♦♦ Thanks, that worked!
(19 Oct '11, 13:50)
dmur
|