Daer all,
I'm having some problems getting my feedback form using perl to work. Here are my files:
1. FormMail.pl - I only pasted what I have edited:
$mailprog = '/usr/lib/sendmail -oi -t';
$postmaster = '';
@referers =
qw(249collision.com);
@allow_mail_to =
qw(mymail@mymail.com);
@recipients = ();
%recipient_alias = ();
@valid_ENV = qw(REMOTE_HOST REMOTE_ADDR REMOTE_USER
and so on...
Note: I have changed the permission for the file when I uploaded on the ftp site also it was an ASCII upload.
2. My feedback form (
http://www.249collision.com/home/techQues.htm):
<FORM
action="http://www.249collision.com/cgi-bin/FormMail.pl"
method="POST" name="TechQues" id="TechQues">
<DIV align=left></DIV>
<FONT
face="Verdana, Arial, Helvetica, sans-serif" size=2>
<INPUT name=recipient type=hidden id="recipient"
value=mymail@mymail.com>
<INPUT name=subject type=hidden id="subject"
value="Technical Question">
<INPUT
name=redirect type=hidden id="redirect"
value=www.249collision.com>
<BR>
Your Name<BR>
<INPUT size=30 name=name22>
</FONT>
and so on...
-----
Problem is when the form is submitted there is an error message saying:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
-----
I'm not too sure where I am going wrong. I have found some possible solutions:
1. How the perl file is called - Perl scripts do not require special /cgi-bin/ directory. You can place the Perl and the PHP scripts in any directory you wish.
The path to the Perl is /usr/bin/perl
The path for the Sendmail is: /usr/sbin/sendmail
2. PHP and Perl scripts require permissions so the server can execute them correctly. If you are getting this error than it means that you have not set the correct permissions.
The required permissions are as follows:
PHP scripts - chmod 755 filename.php
Perl scripts - chmod 755 filemane.cgi
3. If problem still persist next solution is, for Perl and CGI scripts the solution is to add '-w' after the Perl path in your Perl script. It will look like this:
#!/usr/bin/perl -w
This will enable 'warnings' in Perl. Some Perl scripts do not run without this option.
Please help. Thank you