I see by this being your third post that you really really really want this to work. OK, I applaud your tenacity.

First, I don't see a complete HTML document here, no headers, etc. Did you edit that out, or are you really using perl to print just the form and not the whole html?

Have you tried just a "hello.cgi" thing to make sure that Apache2 is running the script at all? (although your output would indicate it is doing so)

Next, can your "hello.cgi" script just open and print a line from a textfile in the same subdir as your db files? This would tell us if somehow Apache2 is preventing you from accessing the files there.

Here is an example, adjust as needed and put in your same CGI subdir:

#!/usr/bin/perl use strict; # fix this filename to match a small file in your db dir my $filename = "/var/www/cgibin/local/clotdesnew1db/file.txt"; # print "Content-type: text/plain\n\n"; print "Hello world\n"; print "filename is $filename\n"; # after first test completes, uncomment the next 5 lines #my @junk; #open(JUNK, $filename)|| die "Cannot open file $filename!"; #@junk = <JUNK>; #close(JUNK); #print "Line 1: $junk[0] \n";
When I ran it here, I got output like this:
Hello world filename is /var/www/cgi-bin/test1.txt Line 1: Dear brother:
Let us know if this works or not, or what your tests tell you...

In reply to Re: cgi works locally, but not on web server by bibo
in thread cgi works locally, but not on web server by talk2kvj

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.