Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: coopster & jatar k & phranque

Message Too Old, No Replies

formmail

     

nikcook

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

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

WebmasterWorld Senior Member 5+ Year Member



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

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

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

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

WebmasterWorld Senior Member 5+ Year Member



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

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

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

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



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

nikcook

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

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

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



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

typomaniac

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

5+ Year Member



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

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



Nice one thanks Typo I'll check it out.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month