php - 仅限 php fatal error 的 error_reporting 编号是多少?

标签 php apache .htaccess error-handling

我目前在我的 htaccess 中设置了这个:

php_value error_reporting -1

我希望日志只记录 fatal error 。我应该用什么替换 -1 来执行此操作?

最佳答案

您始终可以将多个标志与位运算符组合在一起。

echo E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR;

使用 OR 很简单:它只是 1 + 16 + 64 = 81

您可以在 error_reporting() 的手册页上找到示例关于 manual page for bit operators 上的位运算符.

作为旁注:无论如何,您不能使用 PHP 记录 E_CORE_ERRORE_COMPILE_ERROR,因为它们发生在 之前期间 PHPs 启动过程。

关于php - 仅限 php fatal error 的 error_reporting 编号是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11330456/

相关文章:

php - MySQLi while 循环返回空数组。

php - Zend RegEx Validator 的自定义有意义的错误消息

Controller Codeigniter 中的 Javascript

apache - 如何突出显示 Apache Solr 中的搜索文本?

即使禁用 mod_expires,Apache 仍然从缓存加载

php - 删除 URL .php 扩展名会出现 404 错误

php - Wordpress 数据库类 - MySQL Type Bit

apache - .htaccess SEO 友好的 url

android - 在 Android 上下载 APK 时的文件名

.htaccess RewriteRule 返回空白页