Warning: Cannot modify header information - headers already sent by
Permalink 1 user found helpfulI really need some help with this issue... Recently I've been getting the following error whenever my site loads:
Warning: Cannot modify header information - headers already sent by (output started at \\cpt.wa\webs\Data01\Spaces\EIP01\loveandyoga.co.za\wwwroot\index.php:1) in \\cpt.wa\webs\Data01\Spaces\EIP01\loveandyoga.co.za\wwwroot\concrete\libraries\controller.php on line 333
This is the code that appears on the offending line: header("Location: " . $url);
I have no idea what to do and I cannot log in to the dashboard for Concrete - all I get is a blank screen with that particular error message on it.
This is the site's URL:http://www.loveandyoga.co.za/index.php...
Can anyone help me with this issue?

<?php ?>
like scott said, only extra space after php close tag '?> ', will throw this error, session/cookie output/echo/print_r before header
You can unzip and load things in your text editor and they will sometimes insert a blank line or something else..so first you need verify that your download is correct. If this were a widespread issue you'd certainly hear more about it, so I'd double check your download first and install it locally on mamp or xampp or something first.
I'm sorry you're going through this issue but you need to start from the most simple validations and work out from that.
-Scott
headers already sent by (output started at \\EDITED\EDITED\EDITED\EDITED\EDITED\loveandyoga.co.za\wwwroot\index.php:1
See that :1 part. It probably means line #1 or index.php. The thing is that concrete5 does little or nothing in that file. It typically only contains this.
<?php require('concrete/dispatcher.php');
There should be no spaces before the
<?php
and no lines above it. Those two lines are the only thing that should be in it.
Sorry to hear you are having a tough time. Honestly, it's very solvable, we just need to narrow it down and find the place that is outputting that line.
<?php require('concrete/dispatcher.php');
I've tried everything! This is getting massively frustrating... I did find an extra line in the index file, so I deleted it and tried again, but it made no difference.
The strangest thing is that when viewed from one computer, all of the CSS is blocked and unresponsive, but when I check on other computers, all the CSS is working, but the error is still there... This is the strangest thing ever!
I have a feeling that it has something to do with me attempting to build the whole site offline first, because I had no hassles whatsoever when I did everything online... I hope you come right though, it was the most frustrating thing imaginable!
You shouldn't close your code with ?> at the end of a file if that file contains _only_ PHP code.
This would disallow you to add data to your header information and can screw up a few other things, as per the Zend documentation.
Here's a few more details, quote from the docs:
The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include() or require(), so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.
and the only thing I edited was config.php (moving the site, adding different database info)
The error was thrown in concrete/core/libraries/view.php in line 173 wchi is the last line of these:
public function addHeaderItem($item, $namespace = 'VIEW') {
if ($this->resolveItemConflicts($item)) {
$this->headerItems[$namespace][] = $item;
}
}
I tried removing closing php tag from config.php but this caused my site to just load blank pages
Can you help?
I got this problem too.When working with Pagecontroller.
-I've error massage Warning: Cannot modify header information - blah blah blah in controller line 1.
-my first <?php in controller page is clear of white space.
-some page got this error some not.
And I've found that some of my page controller (in controllers\page_types\xxx.php) is encode in UTF-8.(because I'm work in Asian lang.)
When I'm change back to ANSI it's work pretty well.
Hope this help you guy.
I deleted my php close tag (?>) in my controllers.
Its Working fine ;-)
There is a screencast in this post and you can see exactly what was going on before I went through all of this. I really hope this helps someone and if you have any questions or need help I would be happy to oblige, I have gotten some really great help in these forums and my life has been saved more than once between the good people here and at Stack Overflow. I am certainly no expert at this but I am tenacious and if I start it, I will finish it! Good luck and best to you and yours,
Sully
Warning: Cannot modify header information - headers already sent by (output started at /public_html/concrete/libraries/3rdparty/adodb/adodb-xmlschema03.inc.php:1)
It turns out that somehow adodb-xmlschema03.inc.php got corrupted, when I looked at it was just a binary file with all 0s. I replaced it with a fresh copy of the php code from github and now the site is working again!