LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-17-2002, 05:31 PM   #1
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Rep: Reputation: 15
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.
 
Old 10-17-2002, 08:09 PM   #2
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
And your script and guest_book dir are rooted off $APACHE/cgi-bin or $APACHE/htdocs?
if so remove the leading /
 
Old 10-17-2002, 09:05 PM   #3
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
Ok. Thanks for the advice. I'll post my success...
 
Old 10-17-2002, 09:17 PM   #4
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
Thank you very much, neo77777. That did the trick.
 
Old 10-18-2002, 10:06 AM   #5
neo77777
LQ Addict
 
Registered: Dec 2001
Location: Brooklyn, NY
Distribution: *NIX
Posts: 3,704

Rep: Reputation: 56
Unomo problemo
Perl that is.
"Ignorance is bliss" comes from "The Matrix", and I guess Cypher's character was a hardcore Windows whacker.
 
Old 10-18-2002, 11:37 AM   #6
TheLinuxDuck
Member
 
Registered: Sep 2002
Location: Tulsa, OK
Distribution: Slack, baby!
Posts: 349

Rep: Reputation: 33
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. (=
 
Old 10-18-2002, 08:35 PM   #7
GabeF
Member
 
Registered: Mar 2002
Location: New Hampshire, US
Distribution: Mandrake 8.0, Redhat 8.0
Posts: 101

Original Poster
Rep: Reputation: 15
Thanks for your advice too, LinuxDuck.

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to open .sh script file mohsin-mm Linux - Newbie 3 10-01-2005 10:32 AM
how to make a guestbook k1ll3r_x Linux - Software 16 07-09-2005 05:04 PM
PHP Guestbook Linuxidiot Programming 1 04-17-2005 09:53 AM
php guestbook Boby Programming 3 06-21-2004 01:58 PM
Expect script throws "open(slave pty): bad file number" error KNut Linux - Newbie 0 02-24-2004 12:24 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration