1

When I try to run my Perl CGI program, the returned web page tells me:

Software error: For help, please send mail to the webmaster (root@localhost), giving this error message and the time and date of the error.

Here is my code in one of the file:


#!/usr/bin/perl

use lib "/home/ecoopr/ecoopr.com/CPAN";
use CGI;
use CGI::FormBuilder;
use CGI::Session;
use CGI::Carp (fatalsToBrowser);
use CGI::Session;
use HTML::Template;
use MIME::Base64 ();
use strict;

require "./db_lib.pl";
require "./config.pl";

my $query = CGI->new; 
my $url = $query->url();
my $hostname = $query->url(-base => 1);
my $login_url = $hostname . '/login.pl';
my $redir_url = $login_url . '?d=' . $url;
my $domain_name = get_domain_name();

my $helpful_msg = $query->param('m');
my $new_trusted_user_fname = $query->param('u');
my $action = $query->param('a');
$new_trusted_user_fname = MIME::Base64::decode($new_trusted_user_fname);

####### Colin: Added July 12, 2009 #######
my $view = $query->param('view');
my $offset = $query->param('offset');
####### Colin: Added July , 2009 #######

#print $session->header;
#print $new_trusted_user;

my $helpful_msg_txt = qq[];
my $helpful_msg_div = qq[];
if ($helpful_msg)
brian d foy
  • 129,424
  • 31
  • 207
  • 592
kiran
  • 139
  • 1
  • 2
  • 6
  • 3
    Is that your whole script? The very last statement would give you a syntax error. – mob Mar 16 '10 at 20:09
  • 5
    See also **How do I troubleshoot my Perl CGI script**: http://stackoverflow.com/questions/2165022/how-can-i-troubleshoot-my-perl-cgi-script – mob Mar 16 '10 at 20:11
  • Read http://jdporter.perlmonk.org/cgi_course/ - Ovid's CGI Course – Alexandr Ciornii Mar 17 '10 at 08:16
  • no this is my whole script..i can see the page loading correctly but i get this error message on top of the header – kiran Feb 01 '11 at 17:10

3 Answers3

6

The "please send mail to the webmaster" message you see is a generic message that the web server gives you when anything goes wrong and nothing handles it. It's not at all interesting in terms of solving the actual problem. Check the error log to find possible relevant error output from your program.

And, go through my How do I troubleshoot my Perl CGI script? advice on finding the problem.

My guess is that you have a syntax error with that dangling if(). What you have posted isn't a valid Perl program.

Good luck,

Community
  • 1
  • 1
brian d foy
  • 129,424
  • 31
  • 207
  • 592
0

is that something related to suexec module

Improper configuration of suExec can cause permission errors

The suEXEC feature provides Apache users the ability to run CGI and SSI programs under user IDs different from the user ID of the calling web server. Normally, when a CGI or SSI program executes, it runs as the same user who is running the web server.

apache recommends that you not consider using suEXEC. http://httpd.apache.org/docs/2.2/suexec.html

crozoom
  • 11
  • 3
-1

From the StackOverflow page: How to trap program crashes with HTTP error code 500

I see that your include: use CGI::Carp (fatalsToBrowser);
... stifles the HTTP 500 error. Simply removing this will allow the programs to crash "properly".