http://qs1969.pair.com?node_id=367518


in reply to cgi works locally, but not on web server

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...