Jump to content

Archived

This topic is now archived and is closed to further replies.

rexxy

Error: Warning: session_start() and Error: Warning: Cannot modify header information

Recommended Posts

Suddenly without changing anything I am getting a blank page when clicking add to cart or checkout.

 

I turned on php errors and then when viewing the catalog, which displays fine except for a error message at top of screen which is this error:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/swanes/public_html/catalog22/includes/filenames.php:1) in /home/swanes/public_html/catalog22/includes/functions/sessions.php on line 102

 

(possibly this has been displaying all along, even when the cart was working, I had display errors off)

 

 

and when clicking on add to cart or checkout I get that error and another:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/swanes/public_html/catalog22/includes/filenames.php:1) in /home/swanes/public_html/catalog22/includes/functions/sessions.php on line 102

Warning: Cannot modify header information - headers already sent by (output started at /home/swanes/public_html/catalog22/includes/filenames.php:1) in /home/swanes/public_html/catalog22/includes/functions/general.php on line 45

 

I've searched this forum and found a few possible threads that did not help me.

 

1. I checked config for any leading spaces

2. I don't think it's been hacked, I've checked all files and none have been changed since I last changed them myself
3. I've checked and php safe mode isn't on.

 

Can anyone please help me to find out what's gone wrong?

 

Share this post


Link to post
Share on other sites

See the "headers already sent" part of the message? That tells you that there was some output to the browser "too early", before osC had completed its setup and finished setting various HTTP headers. The very first byte of output to the browser (including plain text) forces a flush of all HTTP headers, and no more can be set (thus the message). You need to figure out what the stuff being sent too early to the browser is... it could be an error message, it could be a Byte Order Mark, it could be something a hack is outputting, it could be some stray text from a botched edit. You should be able to see whatever it is by displaying the page source in the browser (View > Page Source).

Share this post


Link to post
Share on other sites

The very first line of your page is

<br />

(a blank and a break tag). You now have to look around for who is outputting this trash. By any chance did you use Dreamweaver (or some other HTML page editor) to edit a PHP file? Never do that! Did you install any add-ons or do any editing?

Share this post


Link to post
Share on other sites

Most likely you will find a .php file with a first line  <br />, before (or on) the <?php line. Simply edit out the blank and break tag (and end-of-line, if it's on its own line) and save the file. In most cases, you will want <?php to be the very first thing in a .php file. You also should check that whatever editor you end up using doesn't insert a "Byte Order Mark" (3 odd characters) at the very beginning of the file.

Share this post


Link to post
Share on other sites

Thanks for trying to help me Phil.

 

Where do you see the first line as <br />  ?

 

Do you mean http://swanes.com.au/catalog22/index.php ?

 

When I view source of http://swanes.com.au/catalog22/index.php I do not see this line.

 

I have gone through a lot of the php files and all I've found start with no blank line and:
 

<?php
/*
  $Id$
 
 
Does anyone have a recommendation of getting commercial help with this problem?

 

Share this post


Link to post
Share on other sites

In my browser, I brought up the page you gave the link to. I told my browser to "Display page source". The very first line, before the error messages, was the space and <br /> tag. It's most likely that comes from a space and <br /> at the very beginning of one of your .php files. You need to find it and edit it out, so that <?php is the very first thing in the file. In fact, the error message tells you exactly where it is: /catalog22/includes/filenames.php at line 1.

Share this post


Link to post
Share on other sites

×