Warning: Cannot modify header information - hea...
2012-11-20 00:00
381 查看
Warning: Cannot modify header information - headers already sent by....
在php页面有时会遇到上面的错误,多半是因为cookie的原因:
cookie本身在使用上有一些限制,例如:
1.呼叫setcookie的敘述必須放在<html>標籤之前
2.呼叫setcookie之前,不可使用echo
3.直到網頁被重新載入後,cookie才會在程式中出現
4.setcookie函數必須在任何資料輸出至瀏覽器前,就先送出
解决方法:
1.修改php安装目录下php.ini配置文件中的output_buffering选项,将output_buffering开启;
如果上面方法不能成功,则采用下面方法:
2.有时可能是
因为 header('Content-Type:text/html;charset= UTF-8');发送头之前不能有任何输出,空格也不行,你需要将header(...)之前的空格去掉,或者其他输出的东西去掉,如果他上面include其他文件了,你还要检查其他文件里是否有输出
3.如果还不能解决,则您可以在程式的最前方加上ob_start();
上面的解决方法是在网上获取的信息,非原创。
在php页面有时会遇到上面的错误,多半是因为cookie的原因:
cookie本身在使用上有一些限制,例如:
1.呼叫setcookie的敘述必須放在<html>標籤之前
2.呼叫setcookie之前,不可使用echo
3.直到網頁被重新載入後,cookie才會在程式中出現
4.setcookie函數必須在任何資料輸出至瀏覽器前,就先送出
解决方法:
1.修改php安装目录下php.ini配置文件中的output_buffering选项,将output_buffering开启;
如果上面方法不能成功,则采用下面方法:
2.有时可能是
因为 header('Content-Type:text/html;charset= UTF-8');发送头之前不能有任何输出,空格也不行,你需要将header(...)之前的空格去掉,或者其他输出的东西去掉,如果他上面include其他文件了,你还要检查其他文件里是否有输出
3.如果还不能解决,则您可以在程式的最前方加上ob_start();
上面的解决方法是在网上获取的信息,非原创。
相关文章推荐
- Warning: Cannot modify header information - headers already sent by....详解
- Warning: Cannot modify header information - headers already sent by (output started at
- 解决Wordpress安装时出现Warning: Cannot modify header information
- 解决Warning: Cannot modify header information - headers already sent b...
- PHP错j解析:Warning: Cannot modify header information - headers already sent by ...
- 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 ...
- 安装wordpress出现:Warning: Cannot modify header information - headers already sent (output started at...)错误解决方案
- Warning: Cannot modify header information原因及解决方案
- 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 (output started at
- 出现Warning: Cannot modify header information - headers already sent by ..的解决办法
- php问题:Warning: Cannot modify header information - headers already sent by ...
- Warning: Cannot modify header information - header
- 解决【Warning: Cannot modify header information - headers already sent by....】
- 解决Warning: Cannot modify header information - headers already sent b...
- Warning: Cannot modify header information原因及解决方案