php中使用header函数后,页面提示:Warnging: Cannot modify header information - headers already sent by 错误的的原因
来源:互联网 发布:chrome js调用本地exe 编辑:程序博客网 时间:2024/06/05 19:46
Warning: Cannot modify header information - headers already sent by 的原因
我的php程序调用了header("Location:www.baidu.com");函数,
运行后出现出现 Warning: Cannot modify header information - headers already sent by 的页面警告。
发现原来是我的php.ini里面的配置的问题,
默认的php.ini文件中,output_buffering指令选项的默认值为off。
把它设为4096就解决了显示提示warning错误的提示。.
php.ini 文件对 output_buffering指令选项做了详细说明如下:
94 ; Output buffering allows you to send header lines (including cookies) even 95 ; after you send body content, at the price of slowing PHP's output layer a 96 ; bit. You can enable output buffering during runtime by calling the output 97 ; buffering functions. You can also enable output buffering for all files by 98 ; setting this directive to On. If you wish to limit the size of the buffer 99 ; to a certain size - you can use a maximum number of bytes instead of 'On', as 100 ; a value for this directive (e.g., output_buffering=4096). 101 #output_buffering = Off 102 output_buffering = 4096
最后,重启,使修改后的配置文件生效。
在Linux下,
如果因PHP命令行而修改php.ini 则不需要重启;
如果因Apache而修改php.ini,则需要重启apache服务;
总之,就是那个服务使用了php,就重新启动该服务,就可以了。
- php中使用header函数后,页面提示:Warnging: Cannot modify header information - headers already sent by 错误的的原因
- php错误"Cannot modify header information - headers already sent by"
- php错误"Cannot modify header information - headers already sent by"
- php 错误Cannot modify header information - headers already sent by
- php 中cookie学习 Warning: Cannot modify header information - headers already sent by错误
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by错误解决办法
- Warning: Cannot modify header information - headers already sent by 错误
- Cannot modify header information - headers already sent by错误解决办法
- Cannot modify header information - headers already sent by出错的原因
- Cannot modify header information - headers already sent by出错的原因
- Cannot modify header information - headers already sent by出错的原因
- Cannot modify header information - headers already sent by出错的原因
- poj3667经典线段树合并操作
- ActionScript 3中自定义命名空间——封装的实现
- win7上安装vs2010报错:microsoft 应用程序错误报告[解决方法]
- 编写TaskMgr.exe的时候学习的知识点
- 黑马程序员--SQL Server 中实现类似Split的字符串分割函数
- php中使用header函数后,页面提示:Warnging: Cannot modify header information - headers already sent by 错误的的原因
- java_文件复制
- 操作系统(Linux/Windows)中解决的问题记录
- git快捷入门 常用命令
- 托盘图标的现实(利用类)
- 存储集合元素的List转换为Map
- 安装完IIS localhost打不开
- Oracle PL SQL :TIPS
- 多边形bool操作效率对比