Home >Backend Development >PHP Tutorial > php 觅bug小技巧

php 觅bug小技巧

WBOY
WBOYOriginal
2016-06-13 12:36:14826browse

php 找bug小技巧

1,file_put_contents("mylog.log",$mesList."\r\n",FILE_APPEND);  //将信息输出到mylog.log这个文件中(常用于在页面无法直接输出时)

2,echo $message ;  //将信息输出到浏览器

exit();

3,die($message) 函数输出一条消息,并退出当前脚本(类似于2)

3,如果是ajax 可以用window.alert($mes);

4:/* 无关代码注释掉*/

5,查看php error.log 

6,配置出错时可以查看apache_error.log文件

Statement:
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