in reply to CGI script gives "internal server error"

hi, i have been through these problems before so these are the posible solution i will go for, 1, can you run the default file which comes with apache( mind that it has #!/ in the correct place) 2, i use to think that Content-type: text/html should be followed by \n\n 3, try to run the file from cmd
  • Comment on Re: CGI script gives "internal server error"

Replies are listed 'Best First'.
Re^2: CGI script gives "internal server error"
by manish.rathi (Acolyte) on Mar 03, 2009 at 21:32 UTC
    default file that comes with apache is running fine.

    I have put shebang line but script still gives same error

    If I run this script from cmd line, how will perl interprete header message ? If I send a request, then server will take care of the header message. Anyways, I tried to run script from cmd line and got error message

    "C:\Program Files\Apache Group\Apache2\cgi-bin>perl server_info.cgi

    Can't find string terminator "END_OF_HTML" anywhere before EOF at server_info.cgi line 3.

      I think you need a newline after the END_OF_HTML, otherwise perl won't recognize it as the heredoc terminator.
        Thanks, you are right. After putting new line after the "END_OF_HTML" , the script is working fine.
        This worked for me. Could't get cgi script with here doc to work (500 error - put new line after the EOF identifier, and it worked.
        Thank you all guys. Problem is solved. I changed print command from "print <<END_OF_HTML" to print qq{ } and the script is working fine now. Now the question is why wd it not work with "END_OF_HTML" ?