Hi! When I call session_start() PHP function, PHP engine (through FastCGI) gives me the next warning:
Warning: session_start() [function.session-start]:
Cannot send session cache limiter - headers already sent (output
started at D:\foo\bar.utf8.php:1) in C:\foo\bar.utf8.php on line 1
The only way I found to avoid this problem is setting my scripts file encoding to ANSI. Actually, I discover that:
- If my script file encoding is ANSI, everything is okay.
- If my script file encoding is UTF-8, I receive the warning described before happens.
- If my script file encoding is Unicode (UTF-16, UCS-2) the web server doesn't give a response, so my browser gets waiting for it.
Talking about my case, UTF-8, the problem seems to be that some output is beeing sent before the header sent by my script. Actually, I can reproduce the same problem with this simple script file:
<?php header("Location: http://forums.iss.net"); ?>
So, as I expected, the warning received is:
Warning: Cannot modify header information - headers already sent
by (output started at C:\foo\bar.utf8.php:1) in C:\foo\bar.utf8.php on line 1
Of course, this problem is solved when I enable ouput_buffering in PHP, allowing my scripts to modify headers whenever. Do you think this is a bug or something wrong in my IIS7/FastCGI/php.ini configuration?
Thanks in advance,
Jesús García Crespo