This PHP project is similar to Lagger. It's based ("compilation") on Nette Debugger (debug bar, emailing) and PHP IDS.

Extended functionality:
- one PHP file include is required
- config file with many settings: developementDebug, privilegedIPs, emailPhpSnooze, PHPWarningEmail, idsReportedLevel, idsRedirectedLevel, idsExceptions, ...
- events (from error handler and also from PHP IDS) can be logged to database

Approx. performance degradation:
- error handling: +0,5MB memory, +2ms exec time
- ids catching: +0.8MB memory, +20ms exec time
- writing events to database (synchro): +1.5MB memory, +50ms exec time

Use case:
IT Operation Manager configures PHPWarningEmail to emails: yours, product manager, developer. If problem is catched, all responsible roles are notified by email. Following is standard fix process.
IT Operation Manager configures idsWarningEmail to your email. If any attack is detected (also false positive), he is notified in realtime.


Live examples (real notifications are sended to Jan Garaj):
Devel user, Strict off
All OK
Notice
Fatal error
Set DB server
zdump $GLOBALS
Impact 6
Impact 17 - redirected
Devel user, Strict on
Strict mode, All OK
Strict mode, Notice
Strict mode, Fatal error
Strict mode, Set DB server
Strict mode, zdump $GLOBALS
Strict mode, Impact 6
Strict mode, Impact 17 - redirected
Normal user, Strict off
Normal user, All OK
Normal user, Notice
Normal user, Fatal error
Normal user, Set DB server
Normal user, zdump $GLOBALS
Normal user, Impact 6
Normal user, Impact 17 - redirected
Normal user, Strict on
Normal user, Strict mode, All OK
Normal user, Strict mode, Notice
Normal user, Strict mode, Fatal error
Normal user, Strict mode, Set DB server
Normal user, Strict mode, zdump $GLOBALS
Normal user, Strict mode, Impact 6
Normal user, Strict mode, Impact 17 - redirected
Fatal error: Uncaught TypeError: Argument 1 passed to NDebug::_exceptionHandler() must be an instance of Exception, instance of Error given in /data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/Debug.php:612 Stack trace: #0 [internal function]: NDebug::_exceptionHandler(Object(Error)) #1 {main} thrown in /data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/Debug.php on line 612 Fatal Error

Fatal Error

Uncaught TypeError: Argument 1 passed to NDebug::_exceptionHandler() must be an instance of Exception, instance of Error given in /data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/Debug.php:612 Stack trace: #0 [internal function]: NDebug::_exceptionHandler(Object(Error)) #1 {main} thrown

Source file

File: /data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/Debug.php   Line: 612

605:    
606:        /**
607:         * Handler to catch uncaught exception.
608:         * @param  Exception
609:         * @return void
610:         * @internal
611:         */
612:        public static function _exceptionHandler(Exception $exception)
613:        {
614:            if (!headers_sent()) { // for PHP < 5.2.4
615:                header('HTTP/1.1 500 Internal Server Error');
616:            }
617:    
618:            $htmlMode = !self::$ajaxDetected && !preg_match('#^Content-Type: (?!text/html)#im'implode("\n"headers_list()));
619:    

Environment

Included files (12)

/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/index.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck.conf.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/zcheck.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/exceptions.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/Debug.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/DebugPanel.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/Object.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/IDebugPanel.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/ZoznamPanel.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/DebugHelpers.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/dibi/dibi.min.min.php
/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/zcheck/Nette/templates/bluescreen.phtml

$_SERVER

GEOIP_COUNTRY_CODE
"US" (2)
UNIQUE_ID
"Zga9_WbDAIqiTcj0MiHTHQAAAAQ" (27)
nokeepalive
"1"
DOCROOT
"/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck" (70)
filter-errordocs
""
HTTP_HOST
"zcheck.jangaraj.com" (19)
HTTP_X_REAL_IP
"3.238.198.167" (13)
HTTP_X_FORWARDED_FOR
"3.238.198.167, 3.238.198.167" (28)
HTTP_X_FORWARDED_PROTO
"http" (4)
HTTP_X_PROXY_IP
"10.20.7.1" (9)
HTTP_ACCEPT
"*/*" (3)
HTTP_USER_AGENT
"claudebot" (9)
HTTP_WS_GEO_COUNTRY
"US" (2)
HTTP_MAX_FORWARDS
"7"
HTTP_X_FORWARDED_HOST
"zcheck.jangaraj.com" (19)
HTTP_X_FORWARDED_SERVER
"zcheck.jangaraj.com" (19)
HTTP_CONNECTION
"close" (5)
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" (60)
SERVER_SIGNATURE
""
SERVER_SOFTWARE
"Apache" (6)
SERVER_NAME
"zcheck.jangaraj.com" (19)
SERVER_ADDR
"127.0.0.1" (9)
SERVER_PORT
"80" (2)
REMOTE_ADDR
"3.238.198.167" (13)
DOCUMENT_ROOT
"/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck" (70)
REQUEST_SCHEME
"http" (4)
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck" (70)
SERVER_ADMIN
"admin@websupport.sk" (19)
SCRIPT_FILENAME
"/data/8/9/89f20e22-67ad-4218-acff-ee497243fcc6/jangaraj.com/sub/zcheck/index.php" (80)
REMOTE_PORT
"54170" (5)
GATEWAY_INTERFACE
"CGI/1.1" (7)
SERVER_PROTOCOL
"HTTP/1.1" (8)
REQUEST_METHOD
"GET" (3)
QUERY_STRING
"g=zdump" (7)
REQUEST_URI
"/?g=zdump" (9)
SCRIPT_NAME
"/index.php" (10)
PHP_SELF
"/index.php" (10)
REQUEST_TIME_FLOAT
1711717885.5
REQUEST_TIME
1711717885
argv
[
   0 => "g=zdump" (7)
]
argc
1

HTTP request

Headers

Hostzcheck.jangaraj.com
X-Real-IP3.238.198.167
X-Forwarded-For3.238.198.167, 3.238.198.167
X-Forwarded-Protohttp
X-Proxy-IP10.20.7.1
accept*/*
user-agentclaudebot
WS-GEO-COUNTRYUS
Max-Forwards7
X-Forwarded-Hostzcheck.jangaraj.com
X-Forwarded-Serverzcheck.jangaraj.com
Connectionclose

$_GET

g
"zdump" (5)

$_POST

empty

$_COOKIE

empty

HTTP response

Headers

no headers