Debugging CGI programs
When writing CGI programs, there are many problems which may affect their execution. Since these will not always be easily understood by examining the web browser output, there are other ways to determine whatÂ’s going wrong.

If there seems to be a problem first try the following steps:
1. Check that your program compiles by using perl -c
2. Check the permissions on your cgi program. If it is not world executable then it won’t work.
3. Run your program on the command line. If your program waits for input, that’s your opportunity to pass in parameters. For the moment, press CTRL-d.
4. If your program runs fine on the command line but still does not output to the browser, make sure that you have not forgotten to print the header before any other output.
5. Check the HTML source that you’re printing. Make sure that you’ve closed any tables you’ve opened and not made any obvious HTML errors.
6. Check the web server’s log files. The location of these vary from system to system. On our system they’re in /var/log/apache/.

the above text is from http://perltraining.com.au/courses/webdev.html

my apache setting is like this in /etc/apache2/httpd.conf and my apache ( Server version: Apache/2.2.3) is able to run cgi scripts properly which is located in /var/www/cgi-bin/

<VirtualHost *> ScriptAlias /cgi-bin/ /var/www/cgi-bin/ <Directory "/var/www/cgi-bin"> Options ExecCGI SetHandler cgi-script </Directory> </VirtualHost>
I found Troubleshooting Perl CGI scripts also helpful.

Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.

In reply to Re: Prompted to Open or Save CGI Program -- configuration issue? by targetsmart
in thread Prompted to Open or Save CGI Program -- configuration issue? by neutron

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.