View Single Post
  #2 (permalink)  
Old 11-20-2003, 04:46 PM
Narasinha's Avatar
Narasinha Narasinha is offline
WebProWorld Pro
 

Join Date: Aug 2003
Location: Urbana, Illinois, US
Posts: 279
Narasinha RepRank 1
Default Perl problems

The dreaded "500 Internal Server Error" can truly be a nightmare. The error itself gives you no information about what caused the error. If you have access to the server logs, the log entries may be able to help with tracking down the actual problem.

The first thing I would check is to see if any Perl CGI at all will work. A simple script to display the webserver's environment variables would be helpful. Here's one that I use:

Code:
#!/usr/bin/perl
############################################
# envcheck.cgi - Check environment variables
############################################

############################################
# Main Program Routine
############################################

&header;
print <<"EOT";
<table border="1" cellpadding="1" cellspacing="1">
<tr><td align="center">Variable</td><td align="center">Contents</td></tr>
EOT
foreach $key (sort keys(%ENV)) {
  print "<tr><td>$key</td><td>$ENV{$key}</td></tr>";
}
print <<"EOT";
</table>
EOT
&footer;

exit (0);

############################################
# Subroutines used in this program are below
############################################

############################################
# Print HTTP and HTML header information

sub header {
  print <<"EOT";
Content-type: text/html

<html>
<head>
  <title>Environment Variable Check</title>
</head>
<body BGCOLOR="#FFFFFF" TEXT="#000000">
EOT
}

# end of sub header
############################################

############################################
# Print HTML footer

sub footer {
  print <<"EOT";
</body>
</html>
EOT
}

# end of sub footer
############################################
Another problem may be in the method the script is using to send the mail. The Unix "sendmail" program is pretty much the standard method, but some servers have this program disabled to prevent sending spam from their server.

If you need more assistance with this problem, feel free to let me know. There may be some special settings required for janeth's server. Oh.. That reminds me... There was a problem executing Perl on one server where I have a few things. I found that I had to add an ".htaccess" file to the cgi-bin directory in order to allow execution. Here are the contents of that file:

Code:
Options +ExecCGI
AddHandler cgi-script cgi pl
This file instructs the server to allow perl execution in that directory and all sub-directories.

Best Regards,
Narasinha
Reply With Quote