php - How not to display the error stack when catching fatal errors -


i set set_exception_handler , set_error_handler handle exceptions , errors, still not catch 'fatal error'.

i tried this:

register_shutdown_function( "fatal_handler" );  function fatal_handler() {     flashmessages::flashit( 'message', 'fatal error' );     include( settings::abspath . '/src/views/message.php' );      $error = error_get_last();      if ( $error !== null ) {         $errno = $error[ "type" ];         $errfile = $error[ "file" ];         $errline = $error[ "line" ];         $errstr = $error[ "message" ];          var_dump( $error );     } } 

and i'm indeed able dump error, there no way avoid full stack error on top of page. how avoid displaying error stack ?

enter image description here

register_shutdown_function( "fatal_handler" );  function fatal_handler() {   $error = error_get_last();   if ( $error[ "type" ] == 1) { //only fatal errors     $errno = $error[ "type" ];     $errfile = $error[ "file" ];     $errline = $error[ "line" ];     $errstr = $error[ "message" ];      flashmessages::flashit("'$errstr' in $errfile in line $errline ", 'fatal error');     include( settings::abspath . '/src/views/message.php' );   } } 

and dont show errors in production outputted php.

ini_set('display_errors', 0); ini_set('display_startup_errors', 0); 

how php errors display?

turn off display error php.ini


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -