Try using WAMP, it doesnt show this error, make sure you donot have spaces before or after the code. For that, if you are using notepad ++ or editplus, go to format and select unix formatting and things should work fine.
OR
try placing this at the top of your page:
<? ob_start(); ?>
then at the bottom of the page place this line of code:
<? ob_flush(); ?>