Results 1 to 9 of 9
  1. #1
    Join Date
    Sep 2004
    Location
    London. UK.
    Posts
    164
    Plugin Contributions
    0

    Default Headers Already Sent Error !

    Hi,

    We came across this problem once we upgraded our test system to the latest version when a new user tries to create a new account:

    Warning: Cannot modify header information - headers already sent by (output started at /hsphere/local/home/proloc10/test.boardgameclub.co.uk/includes/application_top.php:937) in /hsphere/local/home/proloc10/test.boardgameclub.co.uk/includes/functions/functions_general.php on line 52

    After reading some threads and the FAQ's it sound like a space at the end of a line somewhere ?, trouble is, not knowing PHP which file should I be looking at ??

    Thanks in advance.

    Chris.
    Regards,

    Chris (CCN1)

  2. #2
    Join Date
    Sep 2004
    Location
    Western Massachusetts
    Posts
    2,945
    Plugin Contributions
    5

    Default Re: Headers Already Sent Error !

    The first place to look is in the two files mentioned in the error messages. You mentioned that this is error occured after upgrade to the latest version: the error message indicates line 937 of includes/application_top.php but that file in v1.3.0.1 only has 124 lines. Did you upload all of the new files?
    Neville
    An assumption is what you arrive at when you get tired of thinking...

  3. #3
    Join Date
    Jul 2005
    Posts
    211
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    This error usually occurs if you have an empty line or space after the last line of your code.

    You have probably edited a file, and at the end of the code for example..

    </php> space
    or space

    delete up to the very last character.
    This solved my problem when this occurred.

  4. #4
    Join Date
    Sep 2004
    Location
    London. UK.
    Posts
    164
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    Thanks for the reply's all,

    I reinstalled and this fixed the problem, I did it quite late at night and probably did not pay attention to the job at hand........

    Thanks again for your quotes.

    Regards

    Chris.
    Regards,

    Chris (CCN1)

  5. #5
    Join Date
    May 2006
    Posts
    105
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    i've got into the same problem.
    when customer try to change the billing address, he gets this error:

    Warning: Cannot modify header information - headers already sent by (output started at /home/shoptwa/public_html/includes/languages/english/checkout_payment_address.php:79) in /home/shoptwa/public_html/includes/functions/functions_general.php on line 52
    here's the code insite the function_general.php
    // clean up URL before executing it
    while (strstr($url, '&&')) $url = str_replace('&&', '&', $url);
    while (strstr($url, '&amp;&amp;')) $url = str_replace('&amp;&amp;', '&amp;', $url);
    // header locates should not have the &amp; in the address it breaks things
    while (strstr($url, '&amp;')) $url = str_replace('&amp;', '&', $url);

    header('Location: ' . $url);

    zen_exit();
    }
    error is online 52 which is: header('Location: ' . $url);


    now, im quiet new to zencart... has anyone encountered such a bug. my client running on 1.2.6 ,,,
    also, is the bug been fixed in the 1.3.0 ?

  6. #6
    Join Date
    May 2006
    Posts
    105
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    oh well, i think the problem was in the file /includes/languages/english/checkout_payment_address.php some spaces after closing php. so far, things working. if problems happen again, then u'll see me bumping this thread haha

  7. #7
    Join Date
    Aug 2005
    Location
    Cincinnati
    Posts
    334
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    Quote Originally Posted by SysFix
    This error usually occurs if you have an empty line or space after the last line of your code.

    You have probably edited a file, and at the end of the code for example..

    </php> space
    or space

    delete up to the very last character.
    This solved my problem when this occurred.
    This post was a LIFE-SAVER. I was going nuts looking at permissions settings on my cache folder, configure.php settings, you name it -- all because Dreamweaver threw a couple gratuitous spaces at the end of a class file I was tweaking. Nothing like this has happened before, and I've been using DW for years. But when I removed the spaces & replaced the class file, everything was fixed and my heart started beating again.

    Thank you!

  8. #8
    Join Date
    May 2006
    Posts
    105
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    you're welcome. i do understand you when you say your heart is beating again...hahaha. i had to spend 2 hrs today when one of our customers got the error. my boss is happy now too

  9. #9
    Join Date
    Apr 2006
    Posts
    4
    Plugin Contributions
    0

    Default Re: Headers Already Sent Error !

    Hello,

    I am getting a similar message, and it's because I'm trying to install a 3rd party stats calculator called 'CNStats 2'. I'm sure it has something to do with a session cookie already being generated, but have no idea on how to fix this. I would love to see a Zen Cart addon that supports complex stats like referrers and searched keywords, but I have not seen one in any of these forums. Below is a copy of my error.

    Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /mounted-storage/home6/sub002/sc13289-UCZY/troysbooks/index.php:1) in /mounted-storage/home6/sub002/sc13289-UCZY/troysbooks/includes/functions/sessions.php on line 100

    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /mounted-storage/home6/sub002/sc13289-UCZY/troysbooks/index.php:1) in /mounted-storage/home6/sub002/sc13289-UCZY/troysbooks/includes/functions/sessions.php on line 100

    Warning: Cannot modify header information - headers already sent by (output started at /mounted-storage/home6/sub002/sc13289-UCZY/troysbooks/index.php:1) in /mounted-storage/home6/sub002/sc13289-UCZY/troysbooks/includes/init_includes/init_templates.php on line 78

    I have the code for the stats generator at the top of the main index.php file.

    Thanks in advance to anyone in the know about this.

    Jobi

 

 

Similar Threads

  1. Error creating Admin Notifier: headers already sent
    By jeffiec in forum Code Collaboration
    Replies: 5
    Last Post: 28 Jun 2016, 08:52 PM
  2. headers already sent error with WordPress on Zen Cart
    By lilacsandals in forum All Other Contributions/Addons
    Replies: 3
    Last Post: 28 Oct 2008, 06:52 AM
  3. Error after adding product - headers already sent
    By comimpact in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 8 Feb 2008, 01:13 AM
  4. Headers already sent error
    By e-hol.co.uk in forum General Questions
    Replies: 2
    Last Post: 9 Sep 2007, 04:40 PM
  5. error: headers already sent
    By phat in forum General Questions
    Replies: 20
    Last Post: 5 Aug 2007, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg