note 95206 added to function.set-error-handler

From: Date: Fri, 18 Dec 2009 14:11:03 +0000
Subject: note 95206 added to function.set-error-handler
Groups: php.notes 
Request: Send a blank email to php-notes+get-164105@lists.php.net to get a copy of this message
This may be of help to someone, who is/was looking for a way to get a backtrace of fatal errors such as maximum memory allocation issues, which can not be handled with user-defined functions, to pin-point the problem: On a server hosting many sites that share common PHP includes, I set in one spot: @ini_set ("error_log", "/my/path/php.err-" . $_SERVER ["HTTP_HOST"] . "-" . $_SERVER ["REMOTE_ADDR"] . "-" . $_SERVER ["REQUEST_METHOD"] . "-" . str_replace ("/", "|", $_SERVER ["REQUEST_URI"])); I actually used some additional information too from my software that I omitted, but that way, you'll find errors sorted more neatly in for example:- /my/path/php.err-website.com-127.0.0.1-GET-path|index.html?xyz And that at least helped me tremendously to then further pin-point where the problem is, as opposed to before just seeing the out of memory and not knowing which site/page it was on (as the PHP error only contains the very latest PHP code where it ran out of memory, which usually is just a shared included file, not the actual page). ---- Server IP: 69.147.83.197 Probable Submitter: 81.22.249.208 (proxied: 81.22.249.208) ---- Manual Page -- http://www.php.net/manual/en/function.set-error-handler.php Edit -- https://master.php.net/note/edit/95206 Del: integrated -- https://master.php.net/note/delete/95206/integrated Del: useless -- https://master.php.net/note/delete/95206/useless Del: bad code -- https://master.php.net/note/delete/95206/bad+code Del: spam -- https://master.php.net/note/delete/95206/spam Del: non-english -- https://master.php.net/note/delete/95206/non-english Del: in docs -- https://master.php.net/note/delete/95206/in+docs Del: other reasons-- https://master.php.net/note/delete/95206 Reject -- https://master.php.net/note/reject/95206 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#164105) next »