php警告Warning: Cannot modify header information - headers already sent by...
2012-12-28 12:21
525 查看
自己用php建的一个站,在本地运行时没出问题,上传到服务器后,页面顶端经常会出现警告信息:
Warning: Cannot modify header information - headers already sent by....
到网上查找了些资料,似乎是与setcookie相关(不敢确定)。警告信息后面括号中跟了一句"output started at....",意思是在这之前已经在另一处有输出了,网上说找到output started at后面跟的那个文件,看到第一行是空白的,然后才是<?php ... ?>,把第一行删除,就不再提示warning了。我的文件中首行并非空白,但是检查下面的内容发现该文件由两个<?php ... ?>组成,中间隔了一个空白区域,索性把两个<?php
... ?>合并成一个。更新到服务器上后,没再出错,应该是解决了。
网上的另一个解决方案:
在C盘的WINDOWS中找到php.ini 这个配置文件,然后查找一项:output_buffering将其值由原来的off改为on,重新启动Apache就ok了。
Warning: Cannot modify header information - headers already sent by....
到网上查找了些资料,似乎是与setcookie相关(不敢确定)。警告信息后面括号中跟了一句"output started at....",意思是在这之前已经在另一处有输出了,网上说找到output started at后面跟的那个文件,看到第一行是空白的,然后才是<?php ... ?>,把第一行删除,就不再提示warning了。我的文件中首行并非空白,但是检查下面的内容发现该文件由两个<?php ... ?>组成,中间隔了一个空白区域,索性把两个<?php
... ?>合并成一个。更新到服务器上后,没再出错,应该是解决了。
网上的另一个解决方案:
在C盘的WINDOWS中找到php.ini 这个配置文件,然后查找一项:output_buffering将其值由原来的off改为on,重新启动Apache就ok了。
相关文章推荐
- 警告:Warning: Cannot modify header information - headers already sent by (output started at E:\phpweb\
- PHP错误:Warning: Cannot modify header information - headers already sent by ... .
- Warning: Cannot modify header information - headers already sent by ... functions_general.php on line 45
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
- PHP错误:Warning: Cannot modify header information - headers already sent by ...
- 解决PHP Warning: Cannot modify header information - headers already sent by...
- php出错Warning: Cannot modify header information - headers already sent by (output started at
- PHP错误:Warning: Cannot modify header information - headers already sent by ...
- PHP错误:Warning: Cannot modify header information - headers already sent by ...
- PHP错误:Warning: Cannot modify header information - headers already sent by ...
- 转载: PHP错误:Warning: Cannot modify header information - headers already sent by ...
- PHP错j解析:Warning: Cannot modify header information - headers already sent by ...
- PHP warning Cannot modify header information - headers already sent by (output started at...
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
- Warning: Cannot modify header information - headers already sent by (output started at c:/program files/easyphp1-8/www/wp-config
- PHP异常: " Warning: Cannot modify header information - headers already sent by ...."
- PHP错误Warning: Cannot modify header information - headers already sent by解决方法
- PHP错误:Warning: Cannot modify header information - headers already sent by ... .
- php问题:Warning: Cannot modify header information - headers already sent by ...