Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-16 13:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found