Small Session Problem

I’m trying to load the following php document on my personal computer:


<?php
session_start();
?>

But I get the following error:

Cannot send session cookie - headers already sent by (output started at C:\…\session.php:1) in C:\…\session.php on line 2

But that can’t be right. This was a custom install of PHP and Apache on Windows XP, and I’m far from comfortable with that kind of thing, so I’m not sure what kind of information to provide here. Any ideas?

http://php.net/manual/en/function.ob-start.php

According to my knowledge, ob_start won’t help with BOM

Your text editor is putting an invisible Unicode byte order mark at the beginning of your file. Find out how to disable this in your editor.

Is that the only code in the file? And that file is session.php?

That’s a very strange problem.

I changed the encoding to “UTF-8 without BOM” and that did it. Thanks.