"Headers already sent..."
#1
Posted 12 June 2011 - 10:32 PM
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#2
Posted 23 June 2011 - 11:16 PM
Thank you for the information and the contribution. I have installed it and brought up the output start at folder as mentioned in your read me notes. The following is what comes up when I hit go.
I opened the php file and reviewed everything looking for these the comments on the report but there is nothing that has the <?php[0D][0A] or the ?>[0D][0A][0D][0A] mentioned ? I even did a search within the php file.
It says that the php file has 91 lines but when I open my php file in code editor it shows my last line to be 90 and it says ?>
Am I missing something here Jim. Please advise when you have a minute. Thank you so much in advance for provided me with more information. I will also continue to check things in the mean time. I am not sure why this has happened since I have not touched my shipping folders for weeks.
Quote
The PHP start tag is on line 1.
The PHP end tag is on line 90.
Contents from start of file to the PHP start tag:
<?php[0D][0A]
-------------------------
Contents from PHP end tag to end of file:
?>[0D][0A]
[0D][0A]
Error Messages:
The closing PHP tag is not on the last line in the file.
-------------------------
The requested line [92] is out of range.
#3
Posted 23 June 2011 - 11:24 PM
I know it sounds daft but dont reply on a visual inspection
Ricardo
#4
Posted 23 June 2011 - 11:32 PM
You guys are the best !!!!!!
#5
Posted 23 June 2011 - 11:42 PM
Quote
I know it sounds daft but dont reply on a visual inspection
Ricardo
Thank you so much Jim & Ricardo. That did the trick. I am up and running again with no errors.
You guys are the best !!!!!!
#6
Posted 23 August 2011 - 03:09 PM
i am haveing a small problem with this addon, i have installed and configured it as per the installing guide. everything shows up ok when i enter it under the admin section.
The problem i have is the editor seems to add extra characters. for example if i type "testing" it comes up as
rn testing
rn
Any ideas? for some strange reason it seems to be placing Windows Return characters in my text.
Regards
Bret
#7
Posted 27 August 2011 - 03:36 PM
BretSpark, on 23 August 2011 - 03:09 PM, said:
i am haveing a small problem with this addon, i have installed and configured it as per the installing guide. everything shows up ok when i enter it under the admin section.
The problem i have is the editor seems to add extra characters. for example if i type "testing" it comes up as
rn testing
rn
Any ideas? for some strange reason it seems to be placing Windows Return characters in my text.
Regards
Bret
I'll post the contents of the "readme" that is in my contribution so you won't have to download it.
Quote
----------------------
The offical explanation:
http://www.oscommerce.info/confluence/display/OSCDOC22/Error+*+Cannot+Add+Header+Information
Using osC you can't have output to the browser before the session is started (normally in /catalog/includes/application_top.php).
What this really boils down to is the opening php tag ( <?php ) must be at the beginning of the php file, and you cant have anything more that the O/S [eol] after the closing php tag ( ?> ).
If you have any blank lines or spaces or other characters (seen or unseen) in front of the opening tag or after the closing tag you can get the "Headers already sent" error.
Saving a file in UTF-8 format with the Byte Order Mark (BOM) will also cause this error.
The thing about it is since most of the time it's "whitespace(s)" (jargon for "what you can't see") it can be difficult to find the source, let alone fix it.
Then to add "insult to injury" the PHP errors that appear on the page aren't much help.
A few examples taken from the forum:
Warning: Cannot modify header information - headers already sent by (output started at /htdocs/public/www/includes/languages/espanol/modules/payment/transfer.php:19) in /htdocs/public/www/includes/functions/general.php on line 33
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mounted-storage/myshop.com/index.php(1) : eval()'d code:37) in /mounted-storage/myshop.com/includes/functions/sessions.php on line 102
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/html/includes/functions/database.php:307) in /home/html/includes/functions/sessions.php on line 203
Notice that in each case TWO FILES are mentioned! So where does one look?
The very simple answer is: ALWAYS look in the file where the error message says "output started at".
And at the end of that part of the error message a "line number" is given.
I've writen a small helper utility if you have difficulties finding the problem.
Upload the headsent.php file in this contribution into your "catalog" folder. Then access it with your browser.
You are then presented with a "File:" box, an "Optional Line #:" box and a "Do it" button.
Most times just type the the path to the file with the error into the "File:" box then hit [enter] or click the "Do it" button.
More on the "Optional Line #:" box later.
Let's look at each if the three example errors and I'll expand on the contribution's use.
Example No. 1
-------------
Warning: Cannot modify header information - headers already sent by (output started at /htdocs/public/www/includes/languages/espanol/modules/payment/transfer.php:19) in /htdocs/public/www/includes/functions/general.php on line 33
This person would upload headsent.php into the "www" folder, and in the box type: includes/languages/espanol/modules/payment/transfer.php
The offending line in that case is line number 19.
Example No. 2
-------------
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /mounted-storage/myshop.com/index.php(1) : eval()'d code:37) in /mounted-storage/myshop.com/includes/functions/sessions.php on line 102
This person would upload headsent.php into the "myshop.com" folder, and in the box type: index.php
The offending line in that case is line number 1. This shop had been hacked.
Example No. 3
-------------
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/html/includes/functions/database.php:307) in /home/html/includes/functions/sessions.php on line 203
This person would upload headsent.php into the "/home/html/" folder, and in the box type: includes/functions/database.php
The offending line in that case is line number 307.
Now, more about the "Optional Line #:" box.
Most of the time the "Headers already sent" error is because of "whitespaces" or other content at the beginning or end of a file.
I have seen it where there is a php "echo" or other content in the middle of a file that shouldn't be there.
Mostly from downloaded contributions where the developer had some "debug" code they forgot to remove before uploading the contribution.
So if you have a "Headers already sent" problem with a file and the error is on line number say 199 and the file has say 247 lines you know the problem isn't at the end of the file.
And it probably doesn't have 198 blank lines at the beginning of the file so that's where you'd use the "Optional Line #:" box to have the program display that line from the file in your browser.
What should the ouput look like when you run the program?
Normally like this (UNIX O/S):
Contents from start of file to the PHP start tag:
<?php[0A]
-------------------------
Contents from PHP end tag to end of file:
?>[0A]
Or like this (Windowz O/S):
Contents from start of file to the PHP start tag:
<?php[0D][0A]
-------------------------
Contents from PHP end tag to end of file:
?>[0D][0A]
If you have a blank line at the beginning of the file it might look like this:
Contents from start of file to the PHP start tag:
[0A]<?php[0A]
If you saved a file in UTF-8 format with the BOM it might look like this:
Contents from start of file to the PHP start tag:
[EF][BB][BF]<?php[0A]
If you have an extra blank line at the end of the file it might look like this:
Contents from PHP end tag to end of file:
?>[0A][0A]
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#8
Posted 23 January 2012 - 11:48 PM
#9
Posted 18 February 2012 - 05:16 PM
Warning: Cannot modify header information - headers already sent by (output started at /home/iliofosg/public_html/eshop/downunder/includes/template_top.php:14) in /home/iliofosg/public_html/eshop/downunder/includes/functions/general.php on line 35
and with the headsent.php i am taking this
O/S = Linux.
downunder/includes/template_top.php has 74 lines.
The PHP start tag is on line 1.
The PHP end tag is on line 72.
Contents from start of file to the PHP start tag:
<?php[0A]
-------------------------
Contents from PHP end tag to end of file:
?>[0A]
[0A]
<div[20]id="contentText">[0A]
Error Messages:
The closing PHP tag is not on the last line in the file.
-------------------------
Extended contents of the requested line [14] are:
<html[20]<?php[20]echo[20]HTML_PARAMS;[20]?>>[0A]
-------------------------
Raw contents of the requested line [14] are:
>
What do i have to do?
#10
Posted 28 February 2012 - 07:54 AM
This is the message received;
Deprecated: Function eregi() is deprecated in /home/woiqqwab/public_html/yebocom/admin/includes/classes/language.php on line 87
Warning: Cannot modify header information - headers already sent by (output started at /home/woiqqwab/public_html/yebocom/admin/includes/classes/language.php:87) in /home/woiqqwab/public_html/yebocom/admin/includes/functions/general.php on line 22
Any help will be appreciated
Regards
Felix
#11
Posted 28 February 2012 - 06:57 PM
#13
Posted 14 May 2012 - 06:11 PM
Here's the message:
Warning: Cannot modify header information - headers already sent by (output started at *******/admin/products_attributes.php:18) in *******/admin/includes/functions/general.php on line 34
Here is what I got from using the contrib:
O/S = Linux.
admin/products_attributes.php has 1047 lines.
The PHP start tag is on line 1.
The PHP end tag is on line 1047.
Contents from start of file to the PHP start tag:
<?php[0A]
-------------------------
Contents from PHP end tag to end of file:
?>
-------------------------
Extended contents of the requested line [18] are:
<script[20]type="text/javascript">[0A]
-------------------------
Raw contents of the requested line [18] are:
This is what's on line 34 of the admin/includes/functions/general.php file:
header('Location: ' . $url);
#14
Posted 14 May 2012 - 08:38 PM
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#15
Posted 13 June 2012 - 10:33 AM
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/46/d86206271/htdocs/pete/accuity/catalog/includes/edit-wysiwyg.php:20) in /homepages/46/d86206271/htdocs/pete/accuity/catalog/plad/includes/functions/sessions.php on line 67
i plugged includes/edit-wysiwyg.php and i got this answer any ideas please?
O/S = Linux.
includes/edit-wysiwyg.php has 27 lines.
The PHP start tag is on line 1.
The PHP end tag is on line 27.
Contents from start of file to the PHP start tag:
<?php[20][0A]
-------------------------
Contents from PHP end tag to end of file:
?>[0A]
#16
Posted 13 June 2012 - 10:35 AM
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#17
Posted 13 June 2012 - 10:43 AM
// this part determines the physical root of your website
// it's up to you how to do this
if (!ereg('/$', $HTTP_SERVER_VARS['DOCUMENT_ROOT']))
$_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'].'/';
else
$_root = $HTTP_SERVER_VARS['DOCUMENT_ROOT'];
define('DR', $_root);
unset($_root);
// set $spaw_root variable to the physical path were control resides
// don't forget to modify other settings in config/spaw_control.config.php
// namely $spaw_dir and $spaw_base_url most likely require your modification
$spaw_root = DR.'spaw/';
// include the control file
include $spaw_root.'spaw_control.class.php';
// here we add some styles to styles dropdown
$spaw_dropdown_data['style']['default'] = 'No styles';
$spaw_dropdown_data['style']['style1'] = 'Style no. 1';
$spaw_dropdown_data['style']['style2'] = 'Style no. 2';
$copy ="Wysiwyg Editor V1.04 modified SPAW for PHPNuke";
?>
#18
Posted 13 June 2012 - 10:46 AM
Edited by Ingo Bingo, 13 June 2012 - 10:46 AM.
#19
Posted 13 June 2012 - 10:54 AM
Warning: main(/etc/apache2/htdocs/spaw/spaw_control.class.php) [function.main]: failed to open stream: No such file or directory in /homepages/46/d86206271/htdocs/pete/accuity/catalog/includes/edit-wysiwyg.php on line 20
If you haven't changed anything you may be hacked.
I found vulerabilities listed online for spaw_control.class.php
If your file hasn't been patched you may be a hack victim.
"Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice."
- Me -
"Headers already sent" - The definitive help
"Cannot redeclare ..." - How to find/fix it
SSL Implementation Help
Like this post? "Like" it again over there >
#20
Posted 13 June 2012 - 10:57 AM









