I'm running PHP 4.3.2 and Apache 1.3.27 on a RedHat 8 box, with PHP statically compiled with Apache. While executing some arbitrary PHP code, the server ground to an absolute halt. Apache stopped responding, SSH was unreachable, and in fact when I plugged a keyboard and monitor into the server, it took 10-15 seconds for each keystroke to register.
I quickly realized that the PHP code I was executing caused an infinite loop, and watched as the Apache parent process running as 'root' on my server quickly grew to 99.9% CPU usage. This totally killed the server.
From my understanding, the Apache process that runs as root quickly spawns off child processes (running as nobody) and in the event of an infinite loop, it's only those processes that freeze up which should allow the server to function normally. I had accidentally set off infinite loops on my old PHP server - which was installed as a DSO object and not a static install - and these kinds of loops never killed the entire server.
Is this kind of behavior to be expected? Should I just check my code more carefully, or is there some kind of configuration issue here I'm not aware of? Any advice would be greatly appreciated... thanks!
-Cliff