LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Guestbook script cannot open file (https://www.linuxquestions.org/questions/programming-9/guestbook-script-cannot-open-file-33069/)

GabeF 10-17-2002 05:31 PM

Guestbook script cannot open file
 
I am trying to write a simple guestbook, but have been getting the dreaded "internal error" message. After commenting some different code, I think I have the problem narrowed down to these lines:

Code:

open( RDGB, "<$guestbook_URL") ||
  die "Couldn't open guestbook.";

$guestbook_URL = "/guest_book/entries.html"

My root dir is /usr/local/apache2/htdocs

I am running apache2.

I thought it might be permissions, and I set the file to world writeable, but that didn't do the trick. Are there some special directory permissions? Any advice would be appreciated.

neo77777 10-17-2002 08:09 PM

And your script and guest_book dir are rooted off $APACHE/cgi-bin or $APACHE/htdocs?
if so remove the leading /

GabeF 10-17-2002 09:05 PM

Ok. Thanks for the advice. I'll post my success...

GabeF 10-17-2002 09:17 PM

Thank you very much, neo77777. That did the trick.

neo77777 10-18-2002 10:06 AM

Unomo problemo :D
Perl that is.
"Ignorance is bliss" comes from "The Matrix", and I guess Cypher's character was a hardcore Windows whacker.

TheLinuxDuck 10-18-2002 11:37 AM

GabeF:

Something to remember when doing error checking in perl is to try to make good use of the $! error scalar.

It would have given you a better response to what the problem was:
Code:

open IN, $file or die "Can't open '$file': $!\n";
In this case, it would have told you file not found. (=

GabeF 10-18-2002 08:35 PM

Thanks for your advice too, LinuxDuck.

Neo77777, I guess I'll have to update my signature then. Thanks for filling me in.


All times are GMT -5. The time now is 08:50 AM.