Like the title, what is the way to close error prompts in the native mysql and pdo classes to avoid error messages being discovered by hackers. Please provide details on how to modify it
寻觅 beyond2017-09-23 21:41:48
<?php // 关闭所有PHP错误报告 error_reporting(0); // Report simple running errors error_reporting(E_ERROR | E_WARNING | E_PARSE); // 报告 E_NOTICE也挺好 (报告未初始化的变量 // 或者捕获变量名的错误拼写) error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE); // 除了 E_NOTICE,报告其他所有错误 error_reporting(E_ALL ^ E_NOTICE); // 报告所有 PHP 错误 (参见 changelog) error_reporting(E_ALL); // 报告所有 PHP 错误 error_reporting(-1); // 和 error_reporting(E_ALL); 一样 ini_set('error_reporting', E_ALL); ?>
The scope of action is limited to the current program, other php files will not work. If you want all php files to be executed without errors, just modify the error reporting settings in php.ini