robert_gsfame Posted January 15, 2012 Share Posted January 15, 2012 this problem really drives me crazy..hope that anyone could help. I left my page only with <?php session_start(); ?> with no script at all..and i still got error Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at E:\Program Files\XAMPP 1.5.4\xampp\htdocs\folder\page1.php:1) in E:\Program Files\XAMPP 1.5.4\xampp\htdocs\folder\page1.php on line 2 No white space at all. I tried to upload this file into the server (not local) and no error appeared. but when i run it in my local server, error appeared. I restart my xampp so many times but still didn't fix this. what's the problem then? thx in advance Quote Link to comment https://forums.phpfreaks.com/topic/255068-session_start-problem-in-localhost/ Share on other sites More sharing options...
AyKay47 Posted January 15, 2012 Share Posted January 15, 2012 your code editor is encoding your script with a BOM (you can google BOM if you don't know what it is), which outputs to the browser, thus rendering session_start problematic, since no output can be sent to the browser before calling that function. You will need to change you encoding type to UTF-8 without BOM. should be in the settings, under encoding, depending on what editor you are using. Quote Link to comment https://forums.phpfreaks.com/topic/255068-session_start-problem-in-localhost/#findComment-1307873 Share on other sites More sharing options...
PFMaBiSmAd Posted January 15, 2012 Share Posted January 15, 2012 Reply #2 in the sticky post on header errors will probably help - http://www.phpfreaks.com/forums/index.php?topic=37442.0 Quote Link to comment https://forums.phpfreaks.com/topic/255068-session_start-problem-in-localhost/#findComment-1307874 Share on other sites More sharing options...
robert_gsfame Posted January 15, 2012 Author Share Posted January 15, 2012 still confused anyway i use dreamweaver to do the coding...and i've tried to change certain script in my php.ini and still not working. Can help me further with this pls Quote Link to comment https://forums.phpfreaks.com/topic/255068-session_start-problem-in-localhost/#findComment-1307884 Share on other sites More sharing options...
Pikachu2000 Posted January 15, 2012 Share Posted January 15, 2012 display_errors is probably off on your hosting server, but the error is still there. Open the file in your editor, go into your options and make sure it is set up to save files as UTF-8 without BOM. See if that fixes the problem. Quote Link to comment https://forums.phpfreaks.com/topic/255068-session_start-problem-in-localhost/#findComment-1307890 Share on other sites More sharing options...
robert_gsfame Posted January 15, 2012 Author Share Posted January 15, 2012 you both are really helpful!!!! THX A LOT!!! LOVE THIS FORUM! Quote Link to comment https://forums.phpfreaks.com/topic/255068-session_start-problem-in-localhost/#findComment-1307899 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.