Zen Cart Logo
Forums / General Questions / Headers Already Sent Error !

Headers Already Sent Error !

Locked

Views: 1,958

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
23 May 2006, 5:50 PM
#1
ccn1 avatar

ccn1

Zen Follower

Join Date:
Sep 2004
Location:
London. UK.
Posts:
152
Plugin Contributions:
0

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.

23 May 2006, 6:04 PM
#2
bunyip avatar

bunyip

Totally Zenned

Join Date:
Sep 2004
Location:
Western Massachusetts
Posts:
2,361
Plugin Contributions:
1

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?

23 May 2006, 7:15 PM
#3
sysfix avatar

sysfix

Zen Follower

Join Date:
Jul 2005
Posts:
124
Plugin Contributions:
0

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.

25 May 2006, 10:43 PM
#4
ccn1 avatar

ccn1

Zen Follower

Join Date:
Sep 2004
Location:
London. UK.
Posts:
152
Plugin Contributions:
0

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.

26 May 2006, 5:35 PM
#5
chac416 avatar

chac416

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

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, '&&')) $url = str_replace('&&', '&', $url);
// header locates should not have the & in the address it breaks things
while (strstr($url, '&')) $url = str_replace('&', '&', $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 ?

26 May 2006, 6:13 PM
#6
chac416 avatar

chac416

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

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

26 May 2006, 8:05 PM
#7
tvadpro avatar

tvadpro

Zen Follower

Join Date:
Aug 2005
Location:
Cincinnati
Posts:
323
Plugin Contributions:
0

Re: Headers Already Sent Error !

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! :D

26 May 2006, 9:56 PM
#8
chac416 avatar

chac416

Zen Follower

Join Date:
May 2006
Posts:
102
Plugin Contributions:
0

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 :thumbsup:

5 Jun 2006, 2:07 PM
#9
jobiwankinobi avatar

jobiwankinobi

New Zenner

Join Date:
Apr 2006
Posts:
4
Plugin Contributions:
0

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