php异常提示

WBOY
Release: 2016-06-13 12:17:58
Original
1095 people have browsed it

php错误提示
项目出错了,但运行的时候页面一片空白,不知道错在哪里.
在php.ini里error_reporting = E_ALL修改
重启后运行发现还是没有错误提示
------解决思路----------------------
display_errors = On
这样才能看到错误信息

仅 error_reporting = E_ALL 是没有用的
因为 error_reporting 要到程序运行期间才生效,如果错误发生在编译期间呢?

------解决思路----------------------

引用:
在php.ini有如下
; display_errors
;   Default Value: On
;   Development Value: On
;   Production Value: Off
我把1,2,分号去掉.
这样的话我有个疑问,那些警告会显示出来吗?
因为之前连接mysql(说这个连接以后会被遗弃),老是有警告,后来用error_reporting设置忽略警告


你这些是配置文件中的说明部分,实际的配置指令如下
http://cn2.php.net/manual/zh/errorfunc.configuration.php#ini.error-reporting

如版主提供给你的
display_errors = On

还有对于线上的服务器是不应该把它打开的,错误信息中会显示你文件的路径以及资源信息(例如数据库帐号密码),可以让它显示在apache或者nginx的errorlog中

PS: 学PHP要把手册多看看
Related labels:
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 Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!