Code that forces an error message to be displayed at the PHP runtime

  • 2020-05-05 10:59:42
  • OfStack

 
error_reporting(E_ALL); 
ini_set('display_errors', '1'); 
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); // Output the error message to a text file  


How to output the error message to a file, while not letting the error message appear on the website, the online project debugging is very good, you can see the error message, but the client can not see! There is no way to
You can use set_error_handler control

Related articles: