标题()错误不显示在PHP中 [英] header() error not shown in php

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

问题描述

我写了一个PHP程序
我使用 session_start() header()函数,我知道我应该在发送任何东西给客户端之前使用这个函数。没关系,但是为了测试,在使用header()之前,我使用 echotest; 向客户端发送测试消息,但是没有收到任何错误和头文件函数没有任何问题!



在此前的PHP版本中,我会收到如下消息:

 警告:无法修改头信息 - 已在第60行的/some/file.php中输出的头文件(在/some/file.php:22开始输出)

我不知道为什么我没有收到任何错误消息?!

我的php版本是5.3.1, error_reporting 是在 E_ALL

我没有使用任何FrameWork。



问题是 error_reporting('E_ALL');



我在我的第一个程序中编写了这段代码,所以PHP没有返回任何错误!
我删除了这行,我得到了错误!

这是开玩笑,因为这行说PHP显示所有错误!
我不知道为什么PHP不显示任何错误。


I wrote a PHP program, I use session_start() and header() functions, I know I should use this functions before I sending anything to client. it's ok, but for test I send a test message to client with echo "test"; before using header(), but I didn't get any error and header function work without any problem !

In previous versions of PHP at this time I will got a message like :

Warning: Cannot modify header information - headers already sent by (output started at /some/file.php:22) in /some/file.php on line 60

I wan't to know why I didn't get any error message ?!

My php version is 5.3.1 and error_reporting is on E_ALL

解决方案

I found the problem, I don't use any FrameWork.

the problem was error_reporting('E_ALL');

I wrote this code on first of my program, and so PHP didn't return any errors ! I deleted this line and I get the errors !

This is kidding because this line said to PHP to show ALL errors ! I don't know why PHP don't show any errors.

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

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