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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 10:19:25  来源:igfitidea点击:

Codeigniter: Message: Cannot modify header information - headers already sent by (output started at

phpcodeigniter

提问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 <?phpin MY_Controller.php.

<?phpMY_Controller.php 中的 php 打开标签前似乎有空格。

Check all PHP files and remove the whitespace before the <?phptag. 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请求添加新的标头。