Skip to content

Commit e8e915d

Browse files
authored
Create README.md
0 parents  commit e8e915d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# php-errors
2+
PHP错误处理组件,可捕获PHP运行时的所有错误,通过设置错误报告级别及日志记录位置,将PHP运行时的错误信息记录到日志中。
3+
日志记录格式遵守 prs-0 规范。支持 dev 模式和 pro 模式,在 pro 模式下错误信息将不会被填充到响应体中。
4+
通过推荐的 php.ini 配置来初始化 PHP 环境,再这之后的所有错误信息交给 php-errors 组件即可。
5+
6+
# 推荐 php.ini 配置(dev & pro)
7+
```bash
8+
display_errors = Off
9+
display_startup_errors = Off
10+
log_errors = On
11+
error_log = 错误日志记录位置(绝对路径,也可以设置为 syslog,将日志打印到系统日志中)
12+
error_reporting = E_ALL & E_STRICT
13+
```
14+
#### 上述设置中的 error_log 文件位置仅仅作为备用日志文件地址,因为组件会要求配置日志保存位置(文件或者DB中)。

0 commit comments

Comments
 (0)