Fcgi script stuck an invisible

"phoenix_fly" <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <000401c5f79f$676a2f00$0201a8c0@e9w8t5>
Hello Folks

I have something very strange happening here. The .fcgi script runs ok -
well, almost, some memory leaks I can´t figure out how to solve - but then,
after updating the code through ftp, it stops responding, gets stuck and
starts returning 500 errors after a long wait. I issue the "top" command at
shell, but there isn´t any process for this script anywhere.

Then I go check if it runs in the command line and it does! Smoothly! Only
doesn´t at the web!

So, as I have other test script that IS running perfectly from the web
without any problems, I just copied the whole content of the
running-perfectly-from-the-web script and pasted inside the problematic
script, overwriting all its content. Should work, right? It didn´t! So it
isn´t the code (wich is below)! It seems Apache is playing arround with me!

What can I do? You guys know what may cause this oddity??

Thanks

phoenlix_fly



#!/usr/bin/perl -wT

# Loads modules

   use CGI;
   use CGI::Fast;
   use DBI;
   require "./methods.cgi";
   use CGI::Carp qw( fatalsToBrowser );
   use Time::HiRes qw(gettimeofday);
   use strict;

   use lib "/home/myaccount/perl-lib";
   $ENV{'PATH'} = "/usr/local/bin:/usr/bin:/bin";   # (to MIME::Lite)


# We´re online?

  my $online = 1;
  my $mysqlhost = "mysql.myaccount.com";

if ( $ENV{SERVER_NAME} eq "127.0.0.1" ) {
   $online = 0;
   $mysqlhost = "localhost";
}


# Connects to mysql

   [code]

# Start of CGI::Fast loop

   while( my $q = new CGI::Fast ) {

# Start cronometer
my $elapsed = 0.000; my $t0; my $t1;
if ( $online == 1 ) { $t0 = gettimeofday; }


# Reading parameters


   my $cookie = check_string( $q->cookie( -name => "cookie" ) );
   my $section = check_string( $q->param("section") );
   my $start = check_string( $q->param("start") ); defined $start or $start
= 1;

      my $start_mysql = $start - 1;
      my $rec_p_pag = 30;


# Global vars

      my $now = lc formatdate (time);


# Balizamento da ação, conforme a section solicitada

   if ( $section eq "this" ) { this(); }

   else { that(); }


# end of chronometer
if ( $online == 1 ) {
$t1 = gettimeofday;
$elapsed = $t1 - $t0;
print $elapsed;
}

sub this {


   # Query

      $dbh->do ( ...query  );

   # Loading hash

      my %things = load_hash_things();

   # Início do html

      print "Content-type: text/html\n\n";

...html

}

#############
# that
#############

sub that {
 ...

}


} # END OF CGI::FAST LOOP

___________________________________
fastcgi-developers mailing list
http://fastcgi.com/fastcgi-developers/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.