PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Premature end of script (CGI option), Error 500?

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

  • Premature end of script (CGI option), Error 500?

    Can somebody help me with this?
    Why I have this error when trying to open search.cgi
    Thanks

  • #2
    Can you tell us what OS your server is running? Did you select the correct OS option in Zoom (after selecting CGI)?

    It is also possible that your server is configured to handle all CGI files as Perl scripts. Zoom's CGI search is NOT a Perl script. It is a binary executable. You need to make sure that the CGI is not executed by the Perl interpreter. On Windows/IIS, one easy way to do this would be to rename the file from "search.cgi" to "search.exe".

    More information:
    http://www.wrensoft.com/zoom/support....html#cgi_perl
    --Ray
    Wrensoft Web Software
    Sydney, Australia
    Zoom Search Engine

    Comment


    • #3
      In addition to a bad server configuration another possible reason for a 500 error is the server killing the Zoom CGI process before it has completed running. This can happen becuase the Apache RLimitCPU and RLimitMEM directives limits are set too low. (This doesn't apply to the IIS web server). See this post for more details about these directives.
      http://www.wrensoft.com/forum/viewtopic.php?t=12

      The most likely cause is a bad configuration of the Apache web server software however.

      ----
      David

      Comment


      • #4
        We've updated our FAQ with an answer to this question:
        http://www.wrensoft.com/zoom/support...gi_perl_apache
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          I am ran into the same problem. My Linux (RH 9) server was upgraded from Apache 1.x to 2.0.40. The upgrade killed the ability to run binary scripts from the cgi-bin directory. Perl scripts run perfectly. This is exactly the situation described in the updated FAQ section Ray mentions. Namely my web server indeed appears to "be configured to handle all CGI files as Perl scripts."

          The FAQ states "you will need to change your server configuration via the "httpd.conf" file." Any pointers on how? Through some trial and much error I got the scripts working. I finally added the following lines to the site's httpd.include file:

          <Location /cgi-bin>
          Options +ExecCGI
          SetHandler cgiHandler
          </Location>

          This caused the script handler to do something - a search produced paes of binary babble rather than a 500 error. Commenting the above lines out followed by an Apache restart made for a perfectly working search once again. I'm confused but, hey, it works.

          Comment


          • #6
            We don't have more specific instructions for changing "httpd.conf" because the modifications required would vary depending on how your server is currently configured.

            Did you restart Apache after you made those changes? (and before you commented them out?)

            We tried to reproduce this problem on our test server but were unable to do so. It may be worth noting that the above behaviour does not occur with a standard install of ActivePerl for both Apache and IIS on Win32.

            If anyone else is having this same problem, please let us know the OS of your server, Apache version, how Perl is installed (is it compiled with Apache with mod_perl enabled?), and if possible, send us a copy of your "httpd.conf" file.
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment


            • #7
              We've updated our FAQ with another possible cause (and solution) regarding this error:
              http://www.wrensoft.com/zoom/support...gi_perl_apache

              If your Apache server has suEXEC enabled, then you will need to make sure your "search.cgi" file does NOT have global write permissions specified (eg. "chmod 777").

              suEXEC will produce a "premature end of script header" error if any CGI file, or any files which the CGI accesses (eg. the log file), or the "cgi-bin" folder itself, has global write permissions enabled. For more information, please refer to the above URL (under "For Apache users").
              --Ray
              Wrensoft Web Software
              Sydney, Australia
              Zoom Search Engine

              Comment

              Working...
              X