homepage Welcome to WebmasterWorld Guest from 54.166.100.8
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
formmail
nikcook




msg:4208626
 10:06 am on Sep 29, 2010 (gmt 0)

Hi, please bear with me as I am a scripting novice.
I have attempted to use the NMS formmail script on 1 and 1 .co.uk linux hosting.
I keep getting error 500 when I test the form.
I know it's something very basic but for the life of me I can't fathom out where I'm going wrong.
1and1 inform me that I should be using the following line
$mailprog = '/usr/sbin/sendmail -t -i';
but the script readme states that it should be
$mailprog = '/usr/lib/sendmail -oi -t';
and I should only be changing the usr/bin/sendmail section

I have uploaded in ASCII and changed permissions to 755
The html reads
<form method="post" action="/cgi-bin/FormMail.pl">

This is what 1and1 instructed. I have done exactly as they have instructed but it still doesn't work. They are being completely unhelpful as per usual.

Is there anyone out there who has solved this problem or can help to stop me from pulling out what little hair I have left.

Nik

 

janharders




msg:4208745
 2:21 pm on Sep 29, 2010 (gmt 0)

I suppose, the "-i -o" vs "-oi -t" isn't important, but the path has to be changed.
Also: change the first line
(probably "#!/usr/bin/perl")
to
"#!/usr/bin/perl -w", just to make sure it's not a problem with line-endings (ASCII-transmission may not help).

nikcook




msg:4208867
 5:10 pm on Sep 29, 2010 (gmt 0)

OK, this is what I have in the script at the moment.
$mailprog = '/usr/sbin/sendmail -t -i';

and on the first line its
#!/usr/bin/perl -wT

Ive done a check to see the path using myserver.cgi and it threw up all sorts of confusing stuff.

One of which was the path to sendmail it gave
/usr/sbin/sendmail
/usr/lib/sendmail

it also stated
no such file or directory error returned by server

Im assuming that this relates to a cgi-bin

My domain has a subdomain so should I create a cgi-bin folder in the main domain or the subdomain maybe this could be the problem (you can see Im clutching at straws here)

Thanks for your response.

Nik

nikcook




msg:4208875
 5:16 pm on Sep 29, 2010 (gmt 0)

Sorry I should have said that the error is listed under additional information, variable $!, Value No such file or directory, Description error returned by sender

janharders




msg:4209024
 9:00 pm on Sep 29, 2010 (gmt 0)

I'm pretty sure that the cgi-bin is not the problem, iirc, 1 and 1 does not require cgi-scripts to be in a cgi-bin, they just have to end in .pl or .cgi and be executable.
the additional information might indicate that some file could not be opened. I'm not sure, is it maybe configured to show a "thankyou" page that does not exist?
Search for "open" in the source code and make sure the files that it tries to open do exist.

nikcook




msg:4209027
 9:02 pm on Sep 29, 2010 (gmt 0)

Thanks janharders, that's one thing I overlooked. I'll give it a go and let you know what the outcome is.

Cheers
Nik

phranque




msg:4209094
 11:14 pm on Sep 29, 2010 (gmt 0)

500 Internal Server Error is typically accompanied by an entry in the server error log.

nikcook




msg:4210939
 7:36 am on Oct 4, 2010 (gmt 0)

Hi guys, thanks for your help here. 1and1 do not provide an error log, but looking back on janharders post I decided to look more start from new. Once I had set a different path to a new file with new name bingo it worked.

Thanks again for your assistance.

Nik

phranque




msg:4210941
 7:43 am on Oct 4, 2010 (gmt 0)

nice!
thanks, jan.
and since i didn't notice before now:
welcome to WebmasterWorld [webmasterworld.com], Nik!

typomaniac




msg:4211606
 1:02 pm on Oct 5, 2010 (gmt 0)

Not being able to access an error file can be frustrating in itself but you could always add the line
use CGI::Carp qw(fatalsToBrowser);
to your scripts. I've been able to locate things faster using this than with an error file.
Something else which can prove handy is called perl diver for finding paths, installed modules, etc.,....and its a freebie.
Check out [scriptsolutions.com ]

nikcook




msg:4211840
 6:45 pm on Oct 5, 2010 (gmt 0)

Nice one thanks Typo I'll check it out.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved