How to close mysql error prompt
按键盘手指磨破皮
按键盘手指磨破皮 2017-09-22 22:32:48
0
2
1385

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

按键盘手指磨破皮
按键盘手指磨破皮

reply all(2)
寻觅 beyond
<?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

liberty

Using @ annotation will not prompt you


  • reply This is a stupid way. It is definitely unrealistic to write @ on everything. What I mean is modifying the configuration file or opening a certain method.
    按键盘手指磨破皮 author 2017-09-22 22:44:02
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template