PHP不显示错误 [英] php doesnt show error

查看:64
本文介绍了PHP不显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在suse11.0上的php中工作,我的问题是当我键入错误的语法或查询时它不显示错误,仅在此情况下显示空白页

im working in php on suse11.0 my problem is when i type a wrong syntax or query it doesnt show error only blank page shown at this situtaion

谢谢

推荐答案

您可以配置 error_reporting (另请参见),并启用错误显示功能(请参见 display_errors ini_set )-至少在您的开发计算机上

You might to configure error_reporting (see also), and enable the displaying of errors (see display_errors or ini_set) -- at least on your development machine

在您的php.ini文件中,您将使用

In your php.ini file, you'd use

error_reporting = E_ALL | E_STRICT
display_errors = On
html_errors = On

或者,在您的PHP代码中:

Or, in your PHP code :

error_reporting(E_ALL | E_STRICT);
ini_set('display_errors', 'On');

您可能还希望在开发盒上安装 Xdebug ,以获得更好的

You might also want to install Xdebug on your development box, to get nice stacktraces wehn an error / exception occurs


当然,在您的生产机器上,您可能不想显示错误;因此必须根据您的环境进行配置;-)


Of course, on your production machine, you probably don't want to display errors ; so that will have to be configured depending on your environment ;-)

这篇关于PHP不显示错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆