Jump to content

session_start() problem in localhost


robert_gsfame
 Share

Recommended Posts

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

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Are you sure you have something important to add to it?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.