PHP infinite loop kills Apache root process

cliff at cliffmeyers.com cliff at cliffmeyers.com
Sat Sep 13 15:51:33 EDT 2003


Hey folks!  Got another question for you all... maybe Mark can help me with this
one.. :)

Apache 1.3.27
PHP 4.3.0
RedHat 8.0

Originally when I installed PHP with Apache I added it as a shared object.  Since
then I've done an install where PHP is statically linked into the Apache binary
itself.

Occassionally I'll make a coding error which might set off a nasty infinite loop.
 In the past, when PHP was a shared object, the browser would sit for maybe 5
seconds and then I'd get a "server cannot be found" error in MSIE.  What I
assumed was happening is that Apache spawned off the child process to handle my
request, it ran as an infinite loop for a while and then died.  It wasn't a big
deal and it was nice to know that I wouldn't kill my server with a coding error.

However, since I've been using the Apache/PHP static install these infinite loops
do very bad things to my server.  If I set off an infite loop the Apache "root
process" (the Apache process that runs as root as opposed to nobody) immediately
starts to climb towards 100% CPU utilization.  The server totally locks up and
needs to be rebooted.

My question is whether this kind of difference should exist given the two types
of install methods I've used.  It's kind of baffling to see the root Apache
process climb to 100% and then die.  If need be, I'll reinstall Apache with PHP
as a shared object but I was wondering if anyone could shed light on this matter.
 Thanks everyone!


-Cliff



More information about the nflug mailing list