Lots of 500 errors stem from file permissions. Make sure your USERFILE is read/writable by the user that gets assigned to httpd (normally you need to make it 666 on a *nix box. The script itself has to be executable, but you probably know that.

The other most common thing would be that your program prints anything before it prints a valid HTTP header. In this case your program doesn't print anything at all....

Two good sources for debugging this are (1) the http error log on your server. (Location varies from server to server -- RedHat installs it in /var/log/httpd/error_log) and (2) the Carp module. While you are in a debugging phase, it can help enormously to put

use Carp qw/fatalsToBrowser/;
at the top of your program. This sends any run-time errors to the browser window. Compiler errors will have to be seen in the error log, though.

In reply to Re: Problems with 500 server errors by mpolo
in thread Problems with 500 server errors by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.