php Codeigniter:消息:无法修改标头信息 - 标头已发送(输出开始于
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15974891/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Codeigniter: Message: Cannot modify header information - headers already sent by (output started at
提问by Dan
I have created a dynamic menu CMS website. I developed in a Windows system. When i run my project in windows operating system, My project runs without any error. But now uploaded it into Linux Operating system server i am getting warning & error like:
我创建了一个动态菜单 CMS 网站。我是在Windows系统下开发的。当我在 Windows 操作系统中运行我的项目时,我的项目运行没有任何错误。但现在将它上传到 Linux 操作系统服务器,我收到警告和错误,如:
A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at /home/ansofcm8/public_html/apps/resources/math/application/core/MY_Controller.php:1)
Filename: libraries/Session.php
Line Number: 675
What could be the reason. Please help me.
可能是什么原因。请帮我。
回答by HymanPoint
There seems to be whitespace before the php open tag <?php
in MY_Controller.php.
<?php
MY_Controller.php 中的 php 打开标签前似乎有空格。
Check all PHP files and remove the whitespace before the <?php
tag. If there is a space or new line, the body of the http request is started, and you can't add new headers to the http request.
检查所有 PHP 文件并删除<?php
标签前的空格。如果有空格或换行符,则开始http请求的正文,并且无法向http请求添加新的标头。