PHP stops executing for no apparent reason

liunx

Guest
I have an odd issue which is intermittent where PHP will stop working and return the message 'done' in the status bar even though it has done either nothing or processed part of the script. If I refresh the page it might work properly and it might not. Sometimes I refresh the page 4 to 5 times in a row and it stops exectuing with no errors noted, then on try 5 or 6 it runs through perfectly. I recently upgraded to PHP 5.1.1 and Apache 2.2.0, which are installed on Novell SuSE 9.0. Error reporting is set to on, and I have set up lots of visual clues to be sent to the browser if anything fails.

Apart from possible issues in the new PHP and Apache versions I seem to be noticing this where the script calls mysql functions; the Apache server is installed on a Pentium 400 (slow) but the calling machine is a much faster 1.8 GHz. I don't really see why this would make a difference, but it is difficult to tie anything down in the absence of meaningful error messages.

I have included functions to flush the buffers (ob_implicit_flush(true); etc)

I don't have any code to post since I don't know where it is stopping. The same thing happens on several scripts both simple and complex. Must be an option somewhere but not sure where to look.Just some initial questions:

1. Is there anything awry in the apache error log, and also look at the access log to see if transfer time and bytes transferred, status code, etc... match what you expect.
2. When it happens, check for hung or pegged (100%) apache processes (via top or whatever). I've heard rumors that on some systems, Apache 2.2.0 randomly hangs a child process at 100% (specifically, I've heard the rumor for Apache 2.2/Darwin, but who knows...; I've also heard that some people have had luck with a nightly version (2.3?), but that's "at your own risk")
3. Does it still hang when the mysql stuff is commented out?
4. Is mysql hanging? Check the mysql slow-query log (if enabled) for possible problematic queries.
5. Does it hang at EXACTLY the same place each time?
6. How many bytes would the output html/markup total? (related to #1 and #2)Thanks for the hints, looks like apache is the culprit:

[Sat Jan 14 08:09:43 2006] [notice] child pid 3901 exit signal Segmentation fault (11)

error_log is full of these guys. I'll probably go back to 2.0.xupdate your php.ini with setting up PHP vars in display_errors and log_errors to ON mode, and error_reporting = E_ALL. Also update Apache log level to DEBUG - after that restart apache and check up error logs. Seems like incorrect PHP script crashes apache thread(child)
 
Back
Top