I am doing a small web-based project using PHP. Each time I run it, I get weird message like "Warning: session_start(): Cannot send session cookie - headers already sent by", "Warning: session_start(): Cannot send session cache limiter - headers already sent" etc.
I checked my code and found nothing wrong with it. After troubleshooting, I found it is actually due to the encoding which is utf-8 that I used to save the PHP page on the server. Because, if I use a different encoding (e.g, ANSI) it works fine again. For example we may consider the following single line code saved as utf-8 which gives the warning as mentioned in the question title:
<?php session_start();?>
So, at this point I would like to know the possible cause of the problem and also how it can be resolved.
With thanks.