Up-to-date INFO:

OS Home windows 7 32bit Apache 2.2.15 PHP 5.2.13

This is actually strange. After I reached this URI during my application:


Apache crashes.

After I visit a much the same URI - like that one:


Everything works fine.

This really is from error log:

[Thu Aug 05 11:22:14 2010] [notice] Parent: child process exited with status 255 -- Restarting.

I've been in a position to track down the road which in turn causes the Apache to crash:

if (true === $aCourseTree->SetNodePassed($node)) { // this line crashes Apache
    self::writeTreeToDb($aCourseTree, $training, $this->aUtils);

The technique is here now:

public function SetNodePassed(CourseTreeNode $theNode)
    $aWasChange = !isset($theNode->Passed) || $theNode->Passed !== true;
    $theNode->Passed = true;

    if ($aWasChange && isset($theNode->Parent)) {
        if (true === $this->AreChildrenPassed($theNode->Parent)) {
    return $aWasChange;

What the heck is happening? If there's some error, it will you need to be a PHP error. How come Apache crash?

How's it going running PHP inside your Apache?

mod_php can certainly kill an Apache worker process[1], and also the correct strategy for that Apache server in general is to try and go back to as 'clean' a condition as you possibly can. It's extremely difficult for any process to wash up after corrupted memory, but restarting is extremely safe and simple.[2] It is going a lengthy way towards coming back the machine to some known-good condition.

You may decide to change to a FastCGI implementation rather than mod_php if you want more reasons, here is a perfectly-written group of reasons:


[1] The PHP team requested Linux distribution security teams to prevent calling php-interpreter crash bugs "security problems" -- they fixed individuals types of bugs so frequently, that remotely-exploitable security bugs in php and it is libraries were getting drowned in the noise.

[2] Obviously, to re-execute itself, it will have to call among the exec() functions on memory that may be corrupted, but hopefully the only real corrupted memory within the master Apache process will be the scoreboard. So a re-professional ought to be safe enough.