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:
When I ran it here, I got output like this:#!/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";
Let us know if this works or not, or what your tests tell you...Hello world filename is /var/www/cgi-bin/test1.txt Line 1: Dear brother:
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |