php - 如何处理解析和 fatal error ?

标签 php error-handling fatal-error parse-error

我为我的站点编写了一个自定义错误处理程序,并且我知道 PHP 不允许处理解析和 fatal error 。我能做些什么来让它处理这些错误吗?我不希望它们被输出给用户(但我想为它们使用我的错误处理程序)。

谢谢!

最佳答案

如果它无法解析您的脚本,它将无法解析您的自定义错误处理程序。

你应该有 display_errors关闭您的php.ini并设置error_reporting当您的网站处于生产状态时,无。

另外,我相信set_error_handler()可以处理 fatal error 。

关于php - 如何处理解析和 fatal error ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6400844/

相关文章:

php - PHP 上的两个连续的单词正则表达式

php - 从数据库sql转换为数组php

PHP MySQL - 清理和验证建议

Git 产生 "BUG: There are unmerged index entries"

php - Symfony2 : "Fatal error: Class service..." while trying to include a class as an service in config. yml (TCPPDF)

php - Doctrine DQL 查询 - 外键为空时获取行

java - 动态发生异常后运行一些逻辑

r - 打印在for循环中引发错误的列表项,并继续下一个列表项

Xamarin Forms - 线程效率

swift - fatal error : swapping a location with itself is not supported with Swift 2. 0