An "Internal Server Error" is typically triggered by printing something before the proper HTTP headers. This often happens, as in your case, when an error happens and some error message is output. You probably have an error loading the module Config::IniFiles when running as the CGI user. This user account is usually the same as the main web server user, like "nobody", "apache", "http", or similar.

One way to see what is going on is while you're developing your program to use CGI::Carp and more specifically its fatalsToBrowser mode. This allows you to see the error message that's causing the web server to give up on your program by means of injecting a minimal HTTP header in case of errors in the program. It'll just pop the error perl reports right into your browser window over the network as if it was the page you were seeking. That allows you to fix the problem, whatever that may be, and get back to developing the program.

It's probably a good idea to disable this debugging aid when your program goes to production. The end users don't need to know what modules refuse to load and things of that sort. You can always leave it enabled on your development system and enable it as needed on your testing or staging server.


In reply to Re: Using Config::IniFiles in CGI by mr_mischief
in thread Using Config::IniFiles in CGI by KyussRyn

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.