How to track PHP crashes?

I am trying to find the cause of Apache PHP crashes. I hope there is some kind of setup, tool or something that will help determine which code, configuration or which problem is causing these php crashes.

In my windows event log I have (shows Apache crashes but php called):

Faulting application httpd.exe, version 2.2.21.0, time stamp 0x4e6b3136, faulting module php5ts.dll, version 5.3.8.0, time stamp 0x4e537a04, exception code 0xc0000005, fault offset 0x0000c7d7, process id 0xbf4, application start time 0x01cd45afc42f0b7d. 

The application uses Apache, PHP and MySQL on a computer running Windows Server 2008 (xampp).

This is a crash in my Apache log:

 [Fri Jun 08 15:56:34 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting. [Fri Jun 08 15:56:35 2012] [notice] Digest: generating secret for digest authentication ... [Fri Jun 08 15:56:35 2012] [notice] Digest: done [Fri Jun 08 15:56:35 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations [Fri Jun 08 15:56:35 2012] [notice] Server built: Sep 10 2011 11:34:11 [Fri Jun 08 15:56:35 2012] [notice] Parent: Created child process 1220 [Fri Jun 08 15:56:35 2012] [notice] Digest: generating secret for digest authentication ... [Fri Jun 08 15:56:35 2012] [notice] Digest: done [Fri Jun 08 15:56:35 2012] [notice] Child 1220: Child process is running [Fri Jun 08 15:56:35 2012] [notice] Child 1220: Acquired the start mutex. [Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting 150 worker threads. [Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting thread to listen on port 80. [Fri Jun 08 15:56:35 2012] [notice] Child 1220: Starting thread to listen on port 80. [Fri Jun 08 15:57:37 2012] [notice] Parent: child process exited with status 3221225477 -- Restarting. [Fri Jun 08 15:57:37 2012] [notice] Digest: generating secret for digest authentication ... [Fri Jun 08 15:57:37 2012] [notice] Digest: done [Fri Jun 08 15:57:37 2012] [notice] Apache/2.2.21 (Win32) PHP/5.3.8 configured -- resuming normal operations [Fri Jun 08 15:57:37 2012] [notice] Server built: Sep 10 2011 11:34:11 [Fri Jun 08 15:57:37 2012] [notice] Parent: Created child process 3932 [Fri Jun 08 15:57:38 2012] [notice] Digest: generating secret for digest authentication ... [Fri Jun 08 15:57:38 2012] [notice] Digest: done [Fri Jun 08 15:57:38 2012] [notice] Child 3932: Child process is running [Fri Jun 08 15:57:38 2012] [notice] Child 3932: Acquired the start mutex. [Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting 150 worker threads. [Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting thread to listen on port 80. [Fri Jun 08 15:57:38 2012] [notice] Child 3932: Starting thread to listen on port 80. 

Any thoughts on what I should try, or tools / methods to track which code, etc. can cause this?

+4
source share
1 answer

Since XAMPP Apache (for Windows) is built with winn_nt MPM (multi-threaded) + Thread-Safe PHP, it may be that you are facing a problem that is supposedly inherent in PHP versions with Thread-Safe support (see this very good post for more information. ) This may explain why you never encounter an error when working in single-user mode.

Please let us know if Uku Loskit's offer has done its best. If not, I would recommend switching to the PHP version of Prefork + Non-Thread-Safe in such a multi-user environment.

Since MPM must be selected at compile time, you need to either:

  • compile Apache (technically feasible, but pretty pain in the neck on Windows, as far as I remember)
  • find a distribution other than XAMPP that is built using pre-sale (I don't know)

Perhaps you should try running PHP with FastCGI (this extra layer basically isolates the server threads by running a separate PHP process for each thread and much more ). This should allow you to easily check my initial assumptions.

Just a note: I don't see the point of installing Apache on Windows Server. Perhaps you should consider using IIS, optionally with FastGCI (see instructions here ) or (better) switching to a Linux-based stack.

+2
source

All Articles