Loading ...
Sorry, an error occurred while loading the content.

internal server error, among others

Expand Messages
  • air_and_nerve
    This is my second time to try to post this message, so forgive me if it becomes a duplicate... I m using Mac OS X, and I m trying to run a script I copied from
    Message 1 of 3 , Nov 4, 2003
    • 0 Attachment
      This is my second time to try to post this message, so forgive me if it becomes
      a duplicate...

      I'm using Mac OS X, and I'm trying to run a script I copied from a tutorial. The
      script is online at
      http://www.elanus.net/cgi/examples.cgi/view/ex_0302.txt

      It's chmod'ed 755, just like it should be, and the sh-bang line is correct. Yet,
      when I run the program in Terminal, I get:

      ./mail_form.cgi: =: command not found
      ./mail_form.cgi: =: command not found
      ./mail_form.cgi: =: command not found
      ./mail_form.cgi: =: command not found
      ./mail_form.cgi: =: command not found
      ./mail_form.cgi: line 18: syntax error near unexpected token `qw(:'
      ./mail_form.cgi: line 18: `use CGI qw(:standard);'
      [Jessica-Smiths-Computer:/library/webServer/cgi-executables] jessicas%

      When I hit it in Explorer, I get an Internal Server Error, and then my error log
      produces this message:

      [Tue Nov 4 13:21:06 2003] [error] (8)Exec format error: exec of /Library/
      WebServer/CGI-Executables/mail_form.cgi failed
      [Tue Nov 4 13:21:06 2003] [error] [client 192.168.7.33] Premature end of
      script headers: /Library/WebServer/CGI-Executables/mail_form.cgi

      I've searched newsgroups, Perl references, CGI references and 2 dead-tree
      Perl manuals, and I still have no idea what is causing the problem.

      Please help! Thanks.
    • Brad Lhotsky
      I m guessing you clicked on Mac to download the program? For OS 9, you d be good to go, but OS X is based on BSD, Line Feed is a straight line feed, I
      Message 2 of 3 , Nov 4, 2003
      • 0 Attachment
        I'm guessing you clicked on "Mac" to download the program? For OS 9,
        you'd be good to go, but OS X is based on BSD, "Line Feed" is a straight
        line feed, I think Mac used to do something with a null byte or
        something. Have you tried the "Unix" download, which should have just
        line feed's as delimiters? I'm not 100% sure this is the cause of your
        problem, but I have seen similar whacky behavior between windows &
        linux.

        If not, scrutinize the lines up to 'use CGI'. A Syntax highlighting
        editor can go a long ways to helping find typos and what not. I Didn't
        see anything looking at that example. Attack from those two angles
        first.

        Syntax highlighting editors: vim and emacs. They should both have Mac
        OS X versions. If not, learn to love that which is fink
        http://fink.sourceforge.net if not for anything but the GNU 'ls'.

        Hope that helps,

        On Tue, Nov 04, 2003 at 06:41:13PM -0000, air_and_nerve wrote:
        > This is my second time to try to post this message, so forgive me if it becomes
        > a duplicate...
        >
        > I'm using Mac OS X, and I'm trying to run a script I copied from a tutorial. The
        > script is online at
        > http://www.elanus.net/cgi/examples.cgi/view/ex_0302.txt
        >
        > It's chmod'ed 755, just like it should be, and the sh-bang line is correct. Yet,
        > when I run the program in Terminal, I get:
        >
        > ./mail_form.cgi: =: command not found
        > ./mail_form.cgi: =: command not found
        > ./mail_form.cgi: =: command not found
        > ./mail_form.cgi: =: command not found
        > ./mail_form.cgi: =: command not found
        > ./mail_form.cgi: line 18: syntax error near unexpected token `qw(:'
        > ./mail_form.cgi: line 18: `use CGI qw(:standard);'
        > [Jessica-Smiths-Computer:/library/webServer/cgi-executables] jessicas%
        >
        > When I hit it in Explorer, I get an Internal Server Error, and then my error log
        > produces this message:
        >
        > [Tue Nov 4 13:21:06 2003] [error] (8)Exec format error: exec of /Library/
        > WebServer/CGI-Executables/mail_form.cgi failed
        > [Tue Nov 4 13:21:06 2003] [error] [client 192.168.7.33] Premature end of
        > script headers: /Library/WebServer/CGI-Executables/mail_form.cgi
        >
        > I've searched newsgroups, Perl references, CGI references and 2 dead-tree
        > Perl manuals, and I still have no idea what is causing the problem.
        >
        > Please help! Thanks.
        >
        >
        >
        >
        > Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >

        --
        Brad Lhotsky <brad@...>
      • air_and_nerve
        If you mean to download Perl, I didn t have to download it. It was already on my system. I m using BBEdit, and when I save, I change the line-endings to Unix.
        Message 3 of 3 , Nov 6, 2003
        • 0 Attachment
          If you mean to download Perl, I didn't have to download it. It was already on
          my system. I'm using BBEdit, and when I save, I change the line-endings to
          Unix. That shouldn't cause a problem, right?

          Before 'use CGI', there's nothing wacky. The whole script was copied from a
          tutorial that others have used before, so it should work.

          I've looked up some info online about line feeds, but I still don't understand
          what they are or how they work or if they possibly are causing my problem.

          Any further thoughts?

          Thanks.
        Your message has been successfully submitted and would be delivered to recipients shortly.