Home  >  Article  >  Backend Development  >  调试PHP软件工程师

调试PHP软件工程师

WBOY
WBOYOriginal
2016-06-13 13:15:16746browse

调试PHP程序员

出错消息

?

在 php.ini 文件中开启错误报告并设置错误报告的级别:

?

display_errors 变量的目的很明显 ―― 它告诉 PHP 是否显示错误。默认值是 Off。但是,要让开发过程更加轻松,请把这个值设为 On

display_errors = On

error_reporting 变量的默认值是 E_ALL。这个设置会显示从不良编码实践到无害提示到出错的所有信息。E_ALL 对于开发过程来说有点太细,因为它在屏幕上为一些小事(例如变量未初始化)也显示提示,会搞糟浏览器的输出。我只想看到错误和不良编码实践,但是不想看到无害的提示。所以,请用以下值代替 error_reporting 的默认值:

?

error_reporting = E_ALL & ~E_NOTICE

重新启动 Apache,就全部设置好了。

1 楼 Mybeautiful 2012-05-30  
程序员是不能调试的。 调试PHP软件工程师
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