Home > php教程 > php手册 > php日志错误异常处理

php日志错误异常处理

WBOY
Release: 2016-06-13 10:43:24
Original
758 people have browsed it

PHP输出所有的错误报告error_reporting=E_ALL设置

例如不显示警告error_reporting=E_ALL & ~E_WARNING

 

用PHP函数设置PHP.INI ini_set() 如

ini_set(“error_reporting”,E_ALL)

获取PHP.ini里面的值可以用函数ini_get()

如ini_get(“upload_max_filesize”)

PHP不显示错误报告PHP.ini  里面设置display_errors=off

 

我们在开发阶段要开启错误报告,运行阶段不要输入任何一种错误报告(用display_errors=Off)

将错误报告写入日志当中去

 

1:指定输出错误报告error_reproting=E_ALL

2:关闭错误输出display_errors=Off

3:开启错误日志功能 log_errors = On

 

@默认不指定错误日志位置,则默认写到web服务器的日志中

@为error_log指定一个文件名 (日志存放的地方)

@写入到操作系统日志中的用法是error_log=syslog


Rootexp

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template