Announcement

Collapse
No announcement yet.

Formmail contact.cgi in cgi-bin throws an 500 internal server error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Formmail contact.cgi in cgi-bin throws an 500 internal server error

    I am using simple formmail in a file called contact.cgi for my contact page. When I submit the form I am getting a 500 internal error

    Code:
    Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
    
    More information about this error may be available in the server error log.
    the contact.cgi file is saved under cgi-bin under httpdocs folder and the permission on the file is 755

    What am I missing?

    Thanks
    Keyboard Not Found..... Press F1 to continue

    #2
    Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

    The most common issue with that type of script not working correctly is not having permissions set to 705 or 755, which is read/write/execute for user, read/execute for 'other', the group setting (middle digit) can be 0 or 5, doesn't matter which. The second most common issue is having edited the file on a Windows computer and it picking up windows-format line breaks. In that case, the first line of the file should be changed from:

    #!/usr/bin/perl

    to

    #!/usr/bin/perl -w
    David Hubbard
    CIO
    Miva
    [email protected]
    http://www.miva.com

    Comment


      #3
      Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

      Sorry, that may not be correct on the flag, I can't remember if it's -w, -t, -T or perhaps both -w and -T or -t.
      Last edited by ILoveHostasaurus; 10-21-14, 11:53 AM.
      David Hubbard
      CIO
      Miva
      [email protected]
      http://www.miva.com

      Comment


        #4
        Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

        Thanks for replying,

        The file permission is set to 755. and the first line in my contact.cgi is #!/usr/bin/perl -wT.

        The site is hosted with Miva merchant and wondering instead of using the below for $mailprog

        Code:
        $mailprog          = '/usr/sbin/sendmail -oi -t';
        Do I need to use stmp like

        Code:
          $mailprog          = 'SMTP:mysite.com';
        Thanks again
        Keyboard Not Found..... Press F1 to continue

        Comment


          #5
          Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

          Nope that should be fine. I'd open a ticket and reference this thread; should be an easy fix.
          David Hubbard
          CIO
          Miva
          [email protected]
          http://www.miva.com

          Comment


            #6
            Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

            Thanks for replying I got it working by placing the cgi-bin folder as the same level as the httpdocs. But its not sending the email once the form is successfully submitted.

            Where would I open Ticket if I need to. I always used this wonderful community forums :)

            Thanks
            Keyboard Not Found..... Press F1 to continue

            Comment


              #7
              Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

              Is the site hosted with us? If so, you can open a ticket at https://support.mivamerchant.com/sup...Tickets/Submit and just reference this forum thread.
              David Hubbard
              CIO
              Miva
              [email protected]
              http://www.miva.com

              Comment


                #8
                Re: Formmail contact.cgi in cgi-bin throws an 500 internal server error

                I did open the ticket and the ticket id is NXH-919-48612. Thanks again
                Keyboard Not Found..... Press F1 to continue

                Comment

                Working...
                X