|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-11-23 07:44 UTC] stas@php.net
[2000-12-30 20:19 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 10 04:00:01 2026 UTC |
Using the following function as the error handler, the errormsg always ends up blank, though all other fields get filled out as one would expect. ------------------------------- script which reproduces problem ------------------------------- function customErrorHandler ($errno, $errmsg, $filename, $linenum, $vars) { $dt = date("d-m-Y H:i:s (T)"); // What kind of errors can we get? // we probably only care about (user)error, (user)warning, (user)notice $errortype = array ( 1 => "Error", 2 => "Warning", 4 => "Parsing Error", 8 => "Notice", 16 => "Core Error", 32 => "Core Warning", 64 => "Compile Error", 128 => "Compile Warning", 256 => "User Error", 512 => "User Warning", 1024=> "User Notice" ); // set of errors for which a var trace will be saved $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE); $err = "<errorentry>\n"; $err .= "\t<datetime>" . $dt . "</datetime>\n"; $err .= "\t<errornum>" . $errno . "</errornum>\n"; $err .= "\t<errortype>" . $errortype[$errno] . "</errortype>\n"; $err .= "\t<errormsg>" . $errmsg . "</errormsg>\n"; $err .= "\t<scriptname>" . $filename . "</scriptname>\n"; $err .= "\t<scriptlinenum>".$linenum."</scriptlinenum>\n"; if (in_array($errno, $user_errors)) $err .= "<vartrace>\t".wddx_serialize_value($vars,"Variables")."</vartrace>\n"; $err .= "</errorentry>\n\n"; error_log($err, 3, "/var/log/php-error.log"); } $old_error_handler = set_error_handler("customErrorHandler"); ----------------- configure command ----------------- './configure' '--with-imap' '--with-pgsql' '--with-gettext' '--enable-snmp' '--enable-track-vars' '--enable-wddx' '--with-gd=/usr/local' '--enable-trans-sid' '--disable-magic-quotes' '--enable-short-tags' '--with-apxs=/usr/local/sbin/apxs' '--without-mysql' '--without-tsrm-pthreads' '--prefix=/suproot/usr/local'