PHP 如何打开浏览器错误日志记录

发布于 2024-12-04 12:23:04 字数 64 浏览 3 评论 0原文

例如,如果我的 PHP 脚本抛出错误,我希望它打印到浏览器。我使用的是 Debian 5.0 的 linux 盒子

For example if my PHP script throws an error I want it to print to the browser. I am on a linux box Debian 5.0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

尤怨 2024-12-11 12:23:04

将其放在 php 文件的顶部:

//*DEBUG ERROR REPORTING
ini_set('display_errors', 1); 
ini_set('log_errors', 1); 
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); 
error_reporting(E_ALL);
//END DEBUG ERROR REPORTING*/

Put this that the top of your php file:

//*DEBUG ERROR REPORTING
ini_set('display_errors', 1); 
ini_set('log_errors', 1); 
ini_set('error_log', dirname(__FILE__) . '/error_log.txt'); 
error_reporting(E_ALL);
//END DEBUG ERROR REPORTING*/
很酷不放纵 2024-12-11 12:23:04

将 ini 变量 display_error 设置为 1,以向浏览器显示错误。

Set the ini variable display_error to 1, to display errors to the browsers.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文