When I enable this module, I get the following error when logging in after clearing all cookies:

warning: Cannot modify header information - headers already sent by (output started at /var/www/drupal2/includes/bootstrap.inc:696) in /var/www/drupal2/includes/common.inc on line 148.

I didn't find any blank spaces in the beginning of any files, so I'm not sure why this is happening.

Thanks,
Yonas

Comments

Miss Mopi’s picture

I have exactly the same problem.

cloud-dupe2’s picture

me too.

dr_thomas64’s picture

And me

chris-cmfi’s picture

I've got the issue too... so far can't find a solution.

clatho’s picture

I'm also having the same issue... is there any news or hints how to fix this problem?

HalNut’s picture

visitors.info in visitors module.
; $Id: visitors.info,v 1.8 2009/05/09 08:56:19 gashev Exp $

I removed the last blank line in visitors.info. The file was 11 lines now 10.

1. Disable Visitors
2. Remove last blank line (There were 2 blank lines at bottom of file, now there is 1 total 10 lines).
3. Re-enable Visitors
4. Clear cache (Admin->Site Configuration->Performance->Clear cached data
5. Seems to have worked.

I am looking for confirmation.

HalNut’s picture

There may be no issue with the visitors.info file.
While removing the second blank line in the visitors.info seemed to have resolved the issue, I'm not convinced it was the cause, as 2 blank lines (no spaces) at the end of the .info files is not an unusual pattern.

I cannot explain it, it just seemed to work.

fizk’s picture

I doubt that'll fix it, because other modules have blank lines at the end of their .info file.

gashev’s picture

visitors.info hex dump from cvs:

$ hexdump -C visitors.info

00000000  3b 20 24 49 64 3a 20 76  69 73 69 74 6f 72 73 2e  |; $Id: visitors.|
00000010  69 6e 66 6f 2c 76 20 31  2e 38 20 32 30 30 39 2f  |info,v 1.8 2009/|
00000020  30 35 2f 30 39 20 30 38  3a 35 36 3a 31 39 20 67  |05/09 08:56:19 g|
00000030  61 73 68 65 76 20 45 78  70 20 24 0a 6e 61 6d 65  |ashev Exp $.name|
00000040  20 3d 20 56 69 73 69 74  6f 72 73 0a 64 65 73 63  | = Visitors.desc|
00000050  72 69 70 74 69 6f 6e 20  3d 20 22 54 68 69 73 20  |ription = "This |
00000060  6d 6f 64 75 6c 65 20 75  73 65 64 20 66 6f 72 20  |module used for |
00000070  64 69 73 70 6c 61 79 69  6e 67 20 61 20 76 69 73  |displaying a vis|
00000080  69 74 6f 72 73 20 69 6e  66 6f 2e 22 0a 70 61 63  |itors info.".pac|
00000090  6b 61 67 65 20 3d 20 22  56 69 73 69 74 6f 72 73  |kage = "Visitors|
000000a0  22 0a 63 6f 72 65 20 3d  20 22 36 2e 78 22        |".core = "6.x"|
000000ae

visitors.info does not have blank lines.

visitors.info have only 5 lines. Next lines added automatically during create new release.

gashev’s picture

I cannot reproduce this issue. :(

dcaillibaud’s picture

I've the pb (6.x-0.23 with drupal 6.15), and removing blank lines doesn't change anything. The pb occurs only with anonymous user, from the second refresh of any page.
- clear cache
- as anonymous, go to any page => ok
- refresh, still ok
- refresh => KO
- all the next refresh are KO too (going elsewhere then displaying this page again display the error)

Seems like if the third display of any page for anonymous visitors display this error... (cache on)

gashev’s picture

dcaillibaud, what is your enabled modules list?

dthanos216’s picture

I am also seeing this error. I can't find any white spaces anywhere. it happens every time anyone logs in. if you tell me how to output the module list I will provide you with ours.
Thanks.

phosgen’s picture

Setting the Caching-Mode under "Dashboard > Site Configuration > Performance" on "disabled" solved the problem for me.

Regards
Phos

gashev’s picture

dthanos216,

Modules list You can check to admin/build/modules page.

briandj62’s picture

The same for me.

I add that the problem occurs only when the cache is enabled AND an anonymous user goes the same page for the third time, exactly as in comment #11. In other words:

- enable cache/clear cache
- as anonymous, go to any page: OK
- go to any other page of web site: OK
- go again to the first visited page: OK
- go to any other page of web site: OK
- go for the third time to the first visited page: error!

From now on the error appears on ALL the pages visited as anonymous, unless the cache is disabled and cleared.

gashev’s picture

phosgen, thanks a lot!

I reproduced error,

Step to reproduce:
1) Open admin/settings/performance (Performance page).
2) Set Caching mode: normal, Page compression:enable, Block cache:enable, Optimize CSS files:enable, Optimize JavaScript files:enable.
3) Save configuration button click.
4) Clear cached data button click.
5) Logout click (redirect to /).
6) Refresh page, refresh page.
7) Displayed message alert "warning: Cannot modify header information - headers already sent by (output started at includes/bootstrap.inc:690) in includes/common.inc on line 141."

Solution:

visitors.module function visitors_exit,
Change

drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

to

drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);

cvs diff:

cvs diff: Diffing .
Index: visitors.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/visitors/visitors.module,v
retrieving revision 1.21
diff -r1.21 visitors.module
245c245
<   drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
---
>   drupal_bootstrap(DRUPAL_BOOTSTRAP_PATH);

Check, please, this solution. If all ok - I commit it.

briandj62’s picture

OK. I thinks the patch works fine. Thanks!

gashev’s picture

Status: Active » Fixed

Fixed to 6.x-0.25.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

  • Commit bc3a9d0 on 7.x-1.x, master, 8.x-1.x, 7.x-1.x-browscap, 7.x-2.x, 7.x-2.x-browscap-separate-table by gashev:
    bug reports #613222: Module produces "headers already sent by" error.
    
    

  • Commit bc3a9d0 on 7.x-1.x, master, 8.x-1.x, 7.x-1.x-browscap, 7.x-2.x, 7.x-2.x-browscap-separate-table, 8.x-2.x by gashev:
    bug reports #613222: Module produces "headers already sent by" error.