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

Andre

UPDATE: F*, 5 minutes after posting this the fulfilled script started both working and appearing at the "top". This is about 20 minutes after the massive errors, without me having done nothing. How come???

#!/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(); # starting the html print "Content-type: text/html\n\n"; ...html } ############# # that ############# sub that { ... } } # END OF CGI::FAST LOOP

In reply to Fcgi script stuck and invisible by Andre_br

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.