Ok, who wants to help me with a Perl script??

Electric Amish

Elite Member
Oct 11, 1999
23,578
1
0
I'm still wrestling with this damn guestbook on a website. The host won't help me. I'm getting a 500 Internal server error.

You can try it here.

ICQ: 15337385

Thanks

amish
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
does it say anything in the logs?

make sure the file the script writes to is write enabled
 

Electric Amish

Elite Member
Oct 11, 1999
23,578
1
0
Here's the script.

I don't have access to the logs. The files are set to 755 permissions.

My Perl path is net to #!/usr/bin/perl. I verified that with the host.

$guestbook="/bbs.html";

$entriespage="http://www.misconceptionrock.com/bbs.html";




amish
 

AdamDuritz99

Diamond Member
Mar 26, 2000
3,233
0
71
i would check your path lines very closely. But i don't really know what the problem is.

peace
sean
 

Electric Amish

Elite Member
Oct 11, 1999
23,578
1
0


<< i would check your path lines very closely. But i don't really know what the problem is.

peace
sean
>>



That's what I thought. According to the host, I don't need absolute paths on a Unix box.

All I know is that my cgi-bin directory is off my root dir and the .html files are in the htdocs file off the root dir.

When I log in I see:

cgi-bin
htdocs

amish
 

gopunk

Lifer
Jul 7, 2001
29,239
2
0
try it with the absolute paths. i'm pretty damn sure you need them for most cgi-scripts.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
I pm'ed you about it before. I asked you if you had access to the logs. You said you didn't I asked you to create a small file to use to test the server. You didn't want to, then you said you had to go, and asked me to let you know if I came up with anything.

I'm still willing to help, but you've got to put some effort into it.

(i.e. be willing to make that file I was talking about)

!#/usr/bin/perl
print 'Content-type: text/html',"\n\n";
print "test";

that was the entire file I wanted you to make.
 

yllus

Elite Member & Lifer
Aug 20, 2000
20,577
432
126
Still doing some Perl work of my own at the moment and pretty busy, but add this line high up in your code. It should give much better debugging error messages to let you figure out exact faults with your code.

use CGI::Carp qw(fatalsToBrowser);
 

perry

Diamond Member
Apr 7, 2000
4,018
1
0
I think you need that absolute path for the guestbook to be correct.

If you just have /bbs.html then it's looking in the root directory of the file system. You need the directory that your account is actually located in. Maybe something like /users/username/www/bbs.html.
 

Electric Amish

Elite Member
Oct 11, 1999
23,578
1
0
gopunk- I don't have access to the absolute paths. The host won't tell me.

notfred- Sorry, I must have missed that part of our ICQ discussion. I'll try that. :)

amish
 

Electric Amish

Elite Member
Oct 11, 1999
23,578
1
0


<< Run the script from the command line and see what errors does it pop up. >>



It's a remote server, I don't have command line access.

amish
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
I'm at work, so you can get me on AIM at TylerKaraszewski, or you can PM me, and I'll show you what I was going to have you do with that file, if you want.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
oh, and CGI applications will not neccesarily require absolute paths. I've been working on this site for a while now, and there's not one absolute path anywhere in the scripts.

Aparrently my previous choice of words made me an arrogant idiot. I've changed the wording of this post to better please the almighty Phil.
 

Phil21

Golden Member
Dec 4, 2000
1,015
0
0
uhm, "well written" has nothing to do with anything, don't spout FUD.

Moreso requires a clueful person installing the script. It's much easier as a script-writer to explain absolute paths, when many hosts require scripts be put in cgi-bin which is actually a scriptaliased directory, which does not allow viewing other files. I.e. if you wanted the script to open up /something.html in relation to your htroot, you'd put ../htdocs/something.html under certain dir structures. You get the idea, at least.

You don't go and put /something.html because that's what it looks like to the outside world, which is what many, many people mistakingly do, and is what Amish did.

Also, since you're so much better than any perl coder out there, you would also know that execution wrappers that many hosts use (i.e. suexec and others), sometimes modify the pwd, and it gets even harder to "predict" what you should tell your average webmaster to do.

In short, you're an idiot. It may work fine in your specific case, but what works well for you, in that situation does not make others work not "well written".

I can also get into even more issues why absolute pathing is usually better than relative pathing for stuff like this, but I won't bore you.

People spreading FUD piss me off.

-Phil

PS: Amish, via ftp go to the directory where the script is located (where you uploaded it) and type pwd. See what that reports. If nothing, put the folling in a script and chmod accordingly.

!#/usr/bin/perl
print 'Content-type: text/html',"\n\n";
my $pwd = `pwd`;
print "PWD=$pwd";

see what that spits out at ya.

otherwise just try putting that content-type print line right after !#/usr/bin/perl in your script, and you may be able to catch the error in some cases. You need a new host btw, they sound rather clueless. They should at the very least give you access to your logs, and path information. (Unless of course it's free. :p)

-Phil


 

notfred

Lifer
Feb 12, 2001
38,241
4
0
Sorry. Page Fault... had to reboot and I lost your information. Send me another message.

Or, you might not want my help anymore, cause afterall, anyone who thinks relative paths are better than absolute paths for CGI scripts distributed on the internet is an idiot.
 

crystal

Platinum Member
Nov 5, 1999
2,424
0
76
Well,

I pull the script and run it. I got this. I assume no error on script.


Thank You!

Thanks for your entry. Your feedback is greatly appreciated.
Click here to Back, or check out the guestbook entries.

user@emailaddress.com



Are your site is able to run cgi or recognized cgi extension. BTW, if added this in

or die "Can't open file!\n" (where you open your guest book, I got internal error. So that is where I think your error is.)