8

After lot of searching, trying, fixing, waiting and crying and before I give up, I want to take the last chance here for this bug...

We're running on Microsoft Windows Server 2012, Apache/2.4.6 (Win64) OpenSSL/1.0.1e PHP/5.5.1.

Periodically, at least 5-10 times within 24 hours, Apache crashing and restarting. Mostly twice. Because PHP crashed.

The whole application is PHP, so configuring php as FastCGI won't solve the problem: Apache will not crash but PHP will.

here some more info:

Windows Event Log:

Faulting application name: httpd.exe, version: 2.4.6.0, time stamp: 0x51e441d6
Faulting module name: php5ts.dll, version: 5.5.1.0, time stamp: 0x51e849b0
Exception code: 0xc0000005
Fault offset: 0x00000000000572d8
Faulting process id: 0xac0
Faulting application start time: 0x01d0a96634f3d129
Faulting application path: C:\Apache24\bin\httpd.exe
Faulting module path: C:\PHP\php5ts.dll
Report Id: 06409cc4-1568-11e5-93ff-d43d7edb03a9
Faulting package full name:
Faulting package-relative application ID: 

Apache Log:

[Thu Jun 18 06:13:44.284810 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00428: Parent: child process 2752 exited with status 255 -- Restarting.
[Thu Jun 18 06:13:44.487977 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00455: Apache/2.4.6 (Win64) OpenSSL/1.0.1e PHP/5.5.1 configured -- resuming normal operations
[Thu Jun 18 06:13:44.487977 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00456: Apache Lounge VC11 Server built: Jul 15 2013 20:45:22
[Thu Jun 18 06:13:44.487977 2015] [core:notice] [pid 2736:tid 392] AH00094: Command line: 'c:\\Apache24\\bin\\httpd.exe -d C:/Apache24'
[Thu Jun 18 06:13:44.487977 2015] [mpm_winnt:notice] [pid 2736:tid 392] AH00418: Parent: Created child process 4408
  • In PHP log nothing special and no pattern before crash.
  • Also concurrent connections not affecting the problem - it's happens even when we have very few users.
  • MySQL? But no errors pointing to this or I looking in wrong place?
  • Windows? How to figure out?
  • PHP/Apache configuration? Well, what else.. and why?
  • Aliens...

The main question is why PHP is crashing?..

Thanks in advance!

alquist42
  • 739
  • 1
  • 8
  • 21
  • I'm having the same problem as well. However there's no problem running PHP 5.6. I'm suspecting the apache module on PHP is faulty. (Because Apache 2.4 is newer, with many changes might causing things like this) – Izzy Helianthus Jul 11 '15 at 15:11

3 Answers3

2

In my case, nothing more in logs. Only:

 Parent: child process XXXX exited with status 255 -- Restarting

Problem was in redirect code:

<?php
    header('HTTP/1.1 304 Not Modified');
    exit();
?>

This code stops apache service and start new processes. But not all time... sometimes worked fine... sometimes crashes :(

Correct code is:

<?php
    header('HTTP/1.1 304 Not Modified');
    die();
?>

More informations about: PHP: Utilizing exit(); or die(); after header("Location: ");

Community
  • 1
  • 1
ryrysz
  • 907
  • 5
  • 11
1

There is a known bug: Whenever a file you include has a filesize of 4096 or more the php module and apache will stopp working. Thats not a joke!

  • Example: You have a .php file with filesize 53248 bytes. When you include or use this file, then apache fill crash! 53248 / 4096 = 13 - it's a multiple of 4096. This was a bug around PHP 5.3.10 and maybe earlier and later. 5.4 and higher do not have this bug anymore (as far as I know). – user5234989 Aug 17 '15 at 11:12
  • 2
    we are using PHP 5.5, so this won't be the case? – alquist42 Aug 18 '15 at 16:25
0

I think there are several different causes for this child process XYZ exited with status 255 on the net. Most of them are PHP related.

I just had the same crash on Windows, Apache 2.4.18 with PHP 5.6.16, when passing a users' post message through the Markdown parser from http://parsedown.org . Fixed it by surrounding SQL source code in the message which had backticks for identifier quotings, with the three backticks Markdown expects for source code. Did not dive deeper into Parsedown.php to find out where it exactly happened, but it must be something with these backticks.

Anse
  • 1,573
  • 12
  • 27