Welcome to WebmasterWorld Guest from 54.198.60.39

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

formmail

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

New User

5+ Year Member

joined:Sept 29, 2010
posts:6
votes: 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
2:21 pm on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 31, 2008
posts:661
votes: 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).
5:10 pm on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 29, 2010
posts: 6
votes: 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
5:16 pm on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 29, 2010
posts: 6
votes: 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
9:00 pm on Sept 29, 2010 (gmt 0)

Senior Member

WebmasterWorld Senior Member 5+ Year Member

joined:May 31, 2008
posts:661
votes: 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.
9:02 pm on Sept 29, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 29, 2010
posts: 6
votes: 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
11:14 pm on Sept 29, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10553
votes: 13


500 Internal Server Error is typically accompanied by an entry in the server error log.
7:36 am on Oct 4, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 29, 2010
posts: 6
votes: 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
7:43 am on Oct 4, 2010 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10553
votes: 13


nice!
thanks, jan.
and since i didn't notice before now:
welcome to WebmasterWorld [webmasterworld.com], Nik!
1:02 pm on Oct 5, 2010 (gmt 0)

Junior Member from US 

5+ Year Member

joined:Feb 11, 2010
posts: 96
votes: 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 ]
6:45 pm on Oct 5, 2010 (gmt 0)

New User

5+ Year Member

joined:Sept 29, 2010
posts: 6
votes: 0


Nice one thanks Typo I'll check it out.