Problem with Perl emailer

Jenova314

Senior member
Dec 3, 2000
792
0
76
I'd been editting our emailer script to accommodate some of our new products. After uploading the new cgi file, I received an "internal server error" message. I've checked that the file had been uploaded to the proper location ("/cgi-bin/config.cgi"), and the permissions properly set (775). The CGI file had been saved in an UNIX format, with ASCII encoding.

Anybody familiar enough with the matter to help me out? I may very well have fat-fingered the CGI file, and caused these errors.

Here are the relevant files:

config.cgi in txt format
linking webpage in text
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Look at the webserver logs, at least with Apache they're pretty good about pointing out where the problem is.
 

Jenova314

Senior member
Dec 3, 2000
792
0
76
I'd love to poke around at the logs, but our company doesn't even know where the servers are. that would've been the first thing i'd try. we don't run our own servers, so i only have ftp access.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The hosting company doesn't give you access to the logs?

Oh and in unix there's no distinction between binary and ascii files, that's a Windows thing, so try uploading it in binary.
 

cyberia

Platinum Member
Oct 22, 1999
2,535
0
0
If you created the file on a Windows machine (in Notepad or something), it might have an extra CR character at the end-of-line (Link). If you have access to the Unix console, try to open the file in vi and see if there ^M characters there.

If possible, try to run the Perl script from a command prompt. It might show you where the problem is. I hope it is possible because it might be expecting input from a webpage to run at all. Try perl -c at least (Link)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
If possible, try to run the Perl script from a command prompt. It might show you where the problem is. I hope it is possible because it might be expecting input from a webpage to run at all. Try perl -c at least

Seem to run here on the CLI after I change it from DOS->unix format, but without the webpage with the form the email just gets sent with all empty values.
 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
yeah, most likely crappy windows editors. Get vi for windows, or vim for windows and redo the file edits/check for hokey returns.
 

Jenova314

Senior member
Dec 3, 2000
792
0
76
thanks guys. i checked the logfiles, and just as i suspected, the relevant entry is showing:

Premature end of script headers: config.cgi, referer: http://hdlfocus.com/hpc/products/c_amd_1x.html

i'm using textpad in windows, and saving in ansi/unix format. not sure what else i could've done wrong... it's still not acting nice with me.
 

cyberia

Platinum Member
Oct 22, 1999
2,535
0
0
Originally posted by: Jenova314
thanks guys. i checked the logfiles, and just as i suspected, the relevant entry is showing:

Premature end of script headers: config.cgi, referer: http://hdlfocus.com/hpc/products/c_amd_1x.html

i'm using textpad in windows, and saving in ansi/unix format. not sure what else i could've done wrong... it's still not acting nice with me.

Doesn't sound like you read my or nweaver's posts above.