I am getting these errors... Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/seraphic/public_html/index.php:1) in /home/seraphic/public_html/index.php on line 1 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/seraphic/public_html/index.php:1) in /home/seraphic/public_html/index.php on line 1 I know that your supposed to put session_start(); before any output to the browse even white space but for some reason I still get these errors. Also, I made sure session_start(); doesn't appear in any of the includes or anywhere else in the file and it doesn't... This is what the top of my document looks like.. <?php session_start(); include("config.php"); Code (markup): http://www.seraphicgaming.com
Make sure <?php session_start(); ?> is the VERY first thing that appears on your website. If you have any code on your pages which is outputting to the browser before this function call then you'll get the error you've described.
Yes, sometimes it mess up. I had a PHP script which get all the content starting from <? till the last line and rewrite everything to the file. Just doing it resolved the problem. You can also create such a script or use some other editor to remove these characters. Binary editors may be of some help.
Yes Weir, it is the very first thing, nothing is before it, like I posted above it looks like this... <?php session_start(); include("config.php"); and so on... Anyways, mwasif there isn't I was just wondering, anyone else have any ideas?
And the file where session_start() is displayed isn't an include of another file? It's very strange that the error appears AFTER a lot of the page has loaded which would suggest you are already displaying a lot of the page content before the session_start() function call. Is the file where session_start() appears "index.php"?
No session_start(); is above every single thing in that file, again the top of the file looks like this... <?php session_start(); include("config.php"); // rest of the file Code (markup):
oh i see.. check the file (where <?php session_start(); include("config.php") is also included.. this error is caused of writing the session_start() twice or not on the top
Yeah and it's not written anywhere else, and also it's not included twice and it's at the very top as well.
Do an entire site search for "session_start()" and just make sure it's not displayed twice. PM me the FTP details if that doesn't pick up 2 function calls.
I did and there is no other occurrence of session_start() =/ Can you contact me on one of the following Weir, thanks... MSN: AIM: xxmikyboixx
Fixed... Last night I edited the file in notepad because I was being lazy, and apparently notepad changed the filetype to utf-8, I had to manually change it back to ANIS through dreamweaver, very weird, but fixed. (Thanks Weirfire for all the help, great guy!)
The file type of index.php was utf-8 for anyone who ever comes across this error in the future. Make sure your file is saved in ANSI format (Unicode might work as well) [This is seperate from the charset] [EDIT: Beat me to it ]