bivansc has asked for the wisdom of the Perl Monks concerning the following question:
However, it appears that anytime my mod_perl running as a Apache::Filter handler runs the PHP it has a disturbing tendency to create little PHP zombies that never go away until the http server gets too many of them and then has to be restarted.
Here is the relevant code:
if($content =~ /\<\?php (.*?)\?\>/s) { $scrap = $1 . "\n"; $ENV{REDIRECT_STATUS} = "dummy status"; $ENV{REDIRECT_URL} = $ENV{SCRIPT_URI}; $ENV{REDIRECT_URI} = $ENV{SCRIPT_URI}; $ENV{REDIRECT_QUERY_STRING} = $ENV{QUERY_STRING}; open2(\*PHPOUT,\*PHPIN,"php -q 2>&1") or log_error("Rotary::Transl +ations: Unable to open php pipe. Reason: $!\n"); print PHPIN $scrap; close(PHPIN); my $line; while($line = <PHPOUT>) { if( $line eq "Content-type: text/html\n") { next; } $newcontent .= $line; } close(PHPOUT); $content = ""; }
I do close the pipe, so what more do I need to do to make it release the zombie?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Web Zombie problem
by sgifford (Prior) on Oct 16, 2003 at 22:00 UTC | |
|
Re: Perl Web Zombie problem
by pg (Canon) on Oct 16, 2003 at 21:16 UTC |