标题已发送NOT DUPLICATE [重复]

This question already has an answer here:

Okay, today I've got a problem which I can't figure out why.

Error:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/xxdbqmlz/public_html/adw/riser-recliners.php:1) in /home/xxdbqmlz/public_html/adw/riser-recliners.php on line 1

<?php session_start();
if(!empty($_GET['product'])){
    $keyword = htmlspecialchars($_GET['product']);
}else{
   $keyword = "Riser Recline Chair" ;
}

What's surprising is, that is the file, and it has session_start() at the top of file no output is being sent before PHP, not even a small white spaces, no blank line, no html stuff, nothing, that's the very first line which I have, but yet it says headers already sent, I can't see where.

I checked through phpinfo(); but couldn't find anything suspicious, I'm using filezilla to push (I know I shouldn't but for this project, all I have access to is ftp, now the only thing I could think of is filezilla adding empty blank line at top of file, which I doubt.

Can anyone give me pointers?

http://cromwellmobility.co.uk/adw/riser-recliners.php?product=dual-motor-chair

You can see the headers error on the link above and I also have http://cromwellmobility.co.uk/test.php which has phpinfo() if someone think some extension is doing so. I don't have SSH access either since the client I'm working with, doesn't know about SSH.

</div>

If you can confirm that there is no empty space ahead of the opening <?php, my guess is that the current script is being included by an earlier script that has already sent some output to the client.

I ask to confirm there is no empty space because the error message you linked to suggests otherwise. It states:

Warning: session_start(): Cannot send session cookie - headers already sent by (output started at riser-recliners.php:1) in riser-recliners.php on line 2

Notice that the error is triggered by line #2 even though in the OP you suggest that session_start() is on the first line. The error also tells you that there is some output at line 1.

update

Ok try the following:

  1. Rename the file to riser-recliners.BAK.php
  2. copy all the text and paste it in a notepad file. Save it from notepad as riser-recliner.php (same name that the old file had)
  3. Try to access the new file in the browser. If it works, then your code editor is adding content to the beginning of the file.