I\'ve changed my hosting server from a Windows to a Linux system. But when I run my PHP program, I get this errors:
Warning: session_start() [function.sessio
i think you should add
ob_start();
in the first of your code
and in the bottom add
ob_get_contents();
ob_end_flush();
because of
session send headers to server , also you added echo ( this also tell server its html with headers )
server now has to headers so use the ob_start();
and ob_end_flush();
to work :)
You get the error because there are some output before you have initiated session_start(); This could be caused because of your editor that include a BOM character in the beginning of your file. Try open the code in notepad and see if there are any lines before session_start(), (spaces) or things like that and remove them.
To fix your editor if it add a bom in your file, you need to go to your settings and turn it off.
You have a leading BOM, new line or other whitespace character before the opening <?php
tag.
The errors talk about line 2
and line 4
, but in the actual code above session_start()
is called on line 3
. Therefore, leading whitespace is the problem...