error status - how to get it
| From: | Charmaine Tian | Date: | Wed, 10 Apr 2002 22:07:44 +0000 |
| Subject: | error status - how to get it | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-92462@lists.php.net to get a copy of this message | ||
Hi there,
How can I determine if a script is terminated normally or with an error
(execution time out, memory limit exceeded, etc.)?
I'm writing a new PHP extension, and I need to generate an alert if the
script is terminted due to a timeout error or memory limit exceeded error.
However, I cannot find a way to determine the error status.
For time out error, there is a global flag, PG(connection_status), which
supposedly should be set to PHP_CONNECTION_TIMEOUT when timeout happens, but
the flag remains as PHP_CONNECTION_NORMAL.
For memory exceeded error, there is also a global flag,
AG(memory_exhausted). Unfortunately the flag doesn't change when a memory
error happens.
And there is no other global error status, error msg, or errno indicating
the errors.
Can somebody suggest a possible solution for me to get the error? Thanks a
lot.
--Charmaine