Warning messages at top of the page. how can i fix it?
---
Warning: session_start(): Cannot send session cookie - headers already sent by (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 760

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 760

Warning: Cannot modify header information - headers already sent by (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 562

Warning: Cannot modify header information - headers already sent by (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 563

Warning: Cannot modify header information - headers already sent by (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 564
---

Warning: Cannot modify header information - headers already sent by (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 565

Warning: Cannot modify header information - headers already sent by (output started at e:\apache\www\drupal\includes\bootstrap.inc:1) in e:\apache\www\drupal\includes\bootstrap.inc on line 566

Comments

coreyp_1’s picture

Do you have any blank space (or lines) before the <?php in the includes\bootstrap.inc file?

- Corey

HaKi’s picture

no dont have blank spaces.

HaKi’s picture

I have solved the probleme. On saving files (like : *.inc, *php ...) do not add a unicode signature (BOM)! Also open the files you have edited and save again uncheck the checkbox "Add Unicode Signature (BOM)". I use Emeditor.
--
Sorry for my bad english.

mmtaylor’s picture

I have exactly the same problem with a new drupal 4.7.4 site (my first attempt at drupal), which seemed to start up OK initially, but now doesn't. I've no idea what HaKi is talking about with a unicode signature, and I don't have a space before <?php in bootstrap.inc. Because I'm trying to compare Joomla and Drupal, and Joomla requires magic_quotes_gpc to be ON, I've customized php.ini to do that. Could this be related in some way? Settings.php differs from the distribution original only in having the site data inserted where it says to do that. All other files are as distributed.

dgorton’s picture

This is a common PHP error and isn't particularly specific to Drupal. In 99.99% of cases, this error indicates that there are empty spaces and/or blank lines at the beginning of one of your files. Since settings.php is the one that people normally edit, it's the most likely place to look. If you've opened up and/or edited any of the other files, you should check them out as well.

The comment about BOM has to do with Unicode translation and encoding of text files. If that's all nonsensical-techno-gobbeldy-gook to you, perhaps the simplest way to make sure you're not having that same problem is to open your settings.php file in the simplest text editor you can find (something like notepad if you are using Windows). I believe that will strip out any other hidden initial characters that may have been inserted into the beginning of the file -- although I have to confess I haven't tested that.

Drew Gorton
Gorton Studios
Some of our Drupal Sites

Vaughan’s picture

We have a live installation of our website hosted on a Linux server, and it is all working fine.

However, I have just downloaded the entire site, and re-installed it on a Windows box, running apache and now I'm getting the same error.

Is it something to do with Linux/Windows differences?

Going through all the files to see if I can spot extra little spaces.

If anyone else has had the same problem and knows anything, please let me know :)

Thanks

Vaughan

cozzi’s picture

I had this same error when attempting to run DRUSH but the space was at the end not the beginning.

It was true the problem was in the settings.php (I had just edited it) BUT the extra space was at the end of the file, not the beginning.

thx
Cozzi

tapsocial’s picture

I too had same problem and it works fine now after i removed empty spaces at the top of the index.php.

I was editing index.php and left a blank line at the top - now i removed it and it works fine.
~BALA
www.topcityblogs.com

Francewhoa’s picture

Another option that worked for me at http://drupal.org/node/251540#comment-1887994

Loving back your Drupal community result in multiple benefits for you  
pabelmont’s picture

I have PHP files that have worked for years on a commercial LAMP server (Gentoo Linux).
Then I built an Apache2/PHP5/MySql LOCAL server on my PC (UBUNTU) and tested the same PHP programs.
I got the same error messages as everyone else:

Cannot send session cookie - headers already sent by (output started at
etc.

CURE: eliminate all output (PHP PRINT statements) prior to calling PHP's session_start() had been called.
It is as if the code must look like:
<?php session_start();

although insertion of include statements did no harm:

<?php
include_once "../include/xxx.lib";
session_start();

bsmpol’s picture

I am getting the exact problem, but a different line in the bootstrap.inc file:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent in /home2/polskafo/public_html/includes/bootstrap.inc on line 1162

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home2/polskafo/public_html/includes/bootstrap.inc:1162) in /home2/polskafo/public_html/includes/bootstrap.inc on line 1162

I have BlueHost.com run cron, and everything was fine until I added a few modules, and I am wondering if that caused a problem. But, I added many at the same time, so not sure which ones would have caused the problem. When I run cron manually, I do not get any error, but the support at BlueHost said I may have not set Drupal up to send me an email like they have on their servers. There are no errors on the website, so I am tempted to ignore this, but I don't like it.

BlueHost told me to try installing the default php.ini file. I did, and will see if that works so far...