PHP任务已终止但未引发错误情况

A PHP script is using the ZipArchive class and is potentially long running. Since it is dying silently but writing a partial zip file, I wrapped error_log() statements around the $zip->close(). (ini_set sets error logging to a file and E_ALL just before this code) error_log("calling zip->close()"); $rc = $zip->close(); error_log("zip->close() returned $rc");

The logging file shows the first error_log, but never the second. A unix top command shows the process running for a total CPU time of c. 2.5 minutes before it goes defunct.

I have also tried trapping the error with set_error_handler(), and the handler using error_log() to record the catch. But nothing shows up in the log file.

I'm assuming the process is being bounced, maybe by Apache (I have no control over Apache or PHP).

My question is: why can't I see this error in the file being used by error_log?

Thanks for the suggestions for circumventing the problem, but my question remains:

Why can't I see this error in the log? Or why can't I catch this error via set_error_handler()?

set_time_limit(0);

0 = Indefinitely