Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道完全禁用显示错误(例如通过设置error_reporting(0))是一个坏主意,但是有没有办法至少阻止系统路径在实时网站上显示?
error_reporting(0)
在您的生产环境中启用 error_reporting 绝对没有任何问题,只需确保它仅在您的日志中显示display_errors为关闭即可。
display_errors
您可以保留错误报告并使用ini_set('display_errors',0);,以便它们不会显示但仍会记录在错误日志中。
ini_set('display_errors',0);