#142 "headers already sent" notices

closed-fixed
nobody
None
5
2008-01-18
2007-05-30
No

I get the following notices when using current DEVEL, below the message list right after login. I've not yet tracked their exact origin. It seems that subsequently accessed pages do not have these messages. It's probably something session related I think?

Category: PHP, Delayed
Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
FILE: /srv/www/webmail/DEV/devel/functions/global.php
LINE: 419
Category: PHP, Delayed
Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
FILE: /srv/www/webmail/DEV/devel/functions/global.php
LINE: 419
Category: PHP, Delayed
Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
FILE: /srv/www/webmail/DEV/devel/functions/global.php
LINE: 419
Category: PHP, Delayed
Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
FILE: /srv/www/webmail/DEV/devel/functions/global.php
LINE: 419
Category: PHP
Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
FILE: /srv/www/webmail/DEV/devel/functions/global.php
LINE: 419

Discussion

  • Thijs Kinkhorst

    Thijs Kinkhorst - 2007-05-30

    Logged In: YES
    user_id=285765
    Originator: YES

    Accessing folders.php gives these:

    Category: PHP
    Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
    FILE: /srv/www/webmail/DEV/devel/functions/global.php
    LINE: 419
    Category: PHP
    Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
    FILE: /srv/www/webmail/DEV/devel/functions/global.php
    LINE: 419
    Category: PHP
    Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
    FILE: /srv/www/webmail/DEV/devel/functions/global.php
    LINE: 419
    Category: PHP
    Message: Cannot modify header information - headers already sent by (output started at /srv/www/webmail/DEV/devel/class/template/Template.class.php:1379)
    FILE: /srv/www/webmail/DEV/devel/functions/global.php
    LINE: 419

     
  • Jonathan Angliss

    Logged In: YES
    user_id=620333
    Originator: NO

    I can confirm this as well, however in my case it doesn't disappear on the second load. This is one of the set-backs with templating. As everything is running through a central location, a single issue in a plugin is masked by the template output code.

     
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2007-07-10

    Logged In: YES
    user_id=285765
    Originator: YES

    The problem is that sqsetcookie is called way too often, and hence also too late (after output has been started). I haven't found the exact location of the issue yet.

     
  • Jonathan Angliss

    Logged In: YES
    user_id=620333
    Originator: NO

    You could use error_log. Force all errors to be reported to a log file, and then use error_log to record the cookie names. You can at least then see which cookie name is causing the issues.

     
  • CeesT

    CeesT - 2007-08-13

    Logged In: YES
    user_id=1419457
    Originator: NO

    I had exactly the same error message as kink.
    It has something to do with php-buffering. I have not checked the sourcecode as I am not a php programmer, (just wanted to have the 1.52-SVN working) and after googling a while found a similar problem with a solution which seems to work here too. I have changed the php output_buffering to "ON" (it was off) in /etc/php5/apache2/php.ini.
    After a restart of apache the errors do not appear any more.

    Maybe this could also be fixed in the php-code itself without using this directive ???

    Below is the part of php.ini :
    ; Output buffering allows you to send header lines (including cookies) even
    ; after you send body content, at the price of slowing PHP's output layer a
    ; bit. You can enable output buffering during runtime by calling the output
    ; buffering functions. You can also enable output buffering for all files by
    ; setting this directive to On. If you wish to limit the size of the buffer
    ; to a certain size - you can use a maximum number of bytes instead of 'On', as
    ; a value for this directive (e.g., output_buffering=4096).
    output_buffering = On

     
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2007-09-05

    Logged In: YES
    user_id=285765
    Originator: YES

    It seems I can reproduce it on the first load of any folder (in right_main) in a session. Subsequent clicks on that folder do not yield the message.

     
  • Paul Lesniewski

    Paul Lesniewski - 2007-09-29

    Logged In: YES
    user_id=508228
    Originator: NO

    Can you be more specific how to reproduce? I don't see it by going to the "Folders" link (folders.php), nor when logging in (INBOX loads in right_main.php). What plugins are active? Using what skin? I disagree that it's a problem with templating - the problem is someone trying to register a session var or send a cookie after output is already started, which happens no matter what mechanism is used to send the output to the client.

     
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2008-01-18

    Logged In: YES
    user_id=285765
    Originator: YES

    Doesn't happen anymore, think Paul solved it.

     
  • Thijs Kinkhorst

    Thijs Kinkhorst - 2008-01-18
    • status: open --> closed-fixed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks