在浏览器上隐藏 php 错误的最佳方法是什么?
What is the best method of hiding php errors from being displayed on the browser?
是否会使用以下内容:
ini_set("display_errors", 1);
任何最佳实践提示也将不胜感激!
Any best practice tips would be appreciated as well!
我正在记录错误,我只是想确保将 display_errors 值设置为 off(或 0)不会阻止记录错误.
I am logging the errors, I just want to make sure that setting the display_errors value to off (or 0) will not prevent errors from being logged.
最好的方法是记录您的错误,而不是显示或忽略它们.
The best way is to log your errors instead of displaying or ignoring them.
此示例会将错误记录到系统日志中,而不是在浏览器中显示它们.
This example will log the errors to syslog instead of displaying them in the browser.
ini_set("display_errors", 0);
ini_set("log_errors", 1);
//Define where do you want the log to go, syslog or a file of your liking with
ini_set("error_log", "syslog"); // or ini_set("error_log", "/path/to/syslog/file");
这篇关于在生产服务器上抑制 php 错误的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
MySQLi准备好的语句&foreach 循环MySQLi prepared statement amp; foreach loop(MySQLi准备好的语句amp;foreach 循环)
mysqli_insert_id() 是从整个服务器还是从同一用户获Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是从整个服务器还是从同一用户获取记录?)
PHP MySQLi 无法识别登录信息PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 无法识别登录信息)
mysqli_select_db() 需要 2 个参数mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 个参数)
Php mysql pdo 查询:用查询结果填充变量Php mysql pdo query: fill up variable with query result(Php mysql pdo 查询:用查询结果填充变量)
MySQLI 28000/1045 用户“root"@“localhost"的访问MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用户“root@“localhost的访问被拒绝)