I've stopped trying to get the entire login file to work and am now just trying to work on it step by step. I made a test.cgi that just tries to open the directory, print out the files in the directory, open a file in the directory, and print all the lines in the file. So far this test file has been failing. I have other cgi files in the same directory that work just fine. The other files, such as a register.cgi, are a lot more complicated than the login.cgi and test.cgi. This is confusing to me because the register.cgi and some others open directories and files just fine (some open the same directory and files that login and test have failed to open). My ISP is running their Apache server on a Linux based OS. I don't think I can gain access to changing anything on the httpd.config file. The I've checked the permissions on the test.cgi and it's 0755. Also, the error log that is really not making sense to me says this:
[Wed Jun 18 18:07:45 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 18:07:43 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 18:06:34 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 18:04:27 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 18:04:26 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 18:01:53 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 18:00:23 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml [Wed Jun 18 17:58:17 2008] [error] [client 76.193.171.114] File does n +ot exist: /home/hopefulc/public_html/500.shtml
The test.cgi is simpler than the login one that I was initially trying to get to work. The code for it is as follows:
#!/usr/bin/perl -wT use CGI qw(:standard); use CGI::Carp qw(warningsToBrowser fatalsToBrowser); use strict; my ( $dir, #path to directory $dir_file, #sample file in the directory @files, #array of all the files in the directory @lines #array of all the lines in the sample file ); $dir = "/home/hopefulc/public_html/cgi-bin/"; $dir_file = "/home/hopefulc/public_html/cgi-bin/koh_members_list.cgi"; opendir(DIR, $dir) || die("Failed To Open Directory"); @files = readdir(DIR); close(DIR); print header; print start_html("Test CGI"); print "<u><h3>The files in the directory are listed below:</h3></u>\n< +br><br>\n"; foreach my $file (@files) { print "$file\n<br>\n"; } print "<u><h3>The lines in the file are listed below:</h3></u>\n<br><b +r>\n"; open (FILE, $dir_file) || die("Failed To Open File"); @lines = <FILE>; close(FILE); foreach my $line (@lines) { print "$line\n<br>\n"; } print end_html;
If anyone knows what could or might be causing this, it would be greatly appreciated...

In reply to Re: Perl CGI Apache help... by hopefulcd
in thread Perl CGI Apache help... by hopefulcd

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.