Strange behaviour of PHP in Xampp

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Strange behaviour of PHP in Xampp

Postby alicemcline » 10. July 2009 07:06

hi i am getting following error in PHP using Xampp; i searched whole net and found out that i have made file correctly but, it just doesn't seem to work.. :(

Code: Select all
<?php session_start(); ?>
<html>
.
.
.
.
</html>


Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Documents and Settings\*******\Desktop\xampp-win32-1.6.8\xampp\htdocs\login.php:1) in C:\Documents and Settings\*******\Desktop\xampp-win32-1.6.8\xampp\htdocs\login.php on line 1

please somebody help..

btw, sorry for posting this into this forum if its wrong place .. (rest of the forums were not in english and i think its problem regarding PHP in Xampp..)
Last edited by alicemcline on 14. July 2009 13:37, edited 1 time in total.
alicemcline
 
Posts: 10
Joined: 10. July 2009 06:56

Re: Strange behaviour of PHP in Xampp

Postby Wiedmann » 10. July 2009 07:21

I guess your file is utf-8 encoded?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Strange behaviour of PHP in Xampp

Postby alicemcline » 10. July 2009 08:36

yup following line exists after <html><head> tags..
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
alicemcline
 
Posts: 10
Joined: 10. July 2009 06:56

Re: Strange behaviour of PHP in Xampp

Postby Wiedmann » 10. July 2009 08:59

Store your file as utf-8 without BOM.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Strange behaviour of PHP in Xampp

Postby alicemcline » 10. July 2009 10:49

stored but, still not working..

my friend told me that it might work if i editted php.ini and made following changes

; Initialize session on request startup.
session.auto_start = 1

but, even after restarting xampp, it didn't work
alicemcline
 
Posts: 10
Joined: 10. July 2009 06:56

Re: Strange behaviour of PHP in Xampp

Postby Wiedmann » 10. July 2009 15:16

Well, if "<?php session_start(); ?>" is the (very) first line in your code, and the file have no BOM, this must work (without changing anything.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Strange behaviour of PHP in Xampp

Postby roman2 » 14. July 2009 00:10

And it starts at very beginning of the line (no spaces in front).
roman2
 
Posts: 17
Joined: 03. July 2009 15:56
Operating System: 32-bit Windows 7

Re: Strange behaviour of PHP in Xampp

Postby alicemcline » 14. July 2009 13:36

there aren't any spaces before session_start() and when i uploaded same file onto my linux apache server and it shows no errors at all whereas in xampp it is showing following error..

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by .. on line 1 :(

please help
alicemcline
 
Posts: 10
Joined: 10. July 2009 06:56

Re: Strange behaviour of PHP in Xampp

Postby Wiedmann » 14. July 2009 13:51

upload your file to rapidshare (or similar), so we can see the original file you are using.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Strange behaviour of PHP in Xampp

Postby alicemcline » 14. July 2009 14:24

Wiedmann, i have sent you pm with link to uploaded file..
alicemcline
 
Posts: 10
Joined: 10. July 2009 06:56

Re: Strange behaviour of PHP in Xampp

Postby Wiedmann » 14. July 2009 14:32

here's link to uploaded file

Well, this file "login.php" still have a BOM.

You remember:
Wiedamann wrote:Store your file as utf-8 without BOM.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: Strange behaviour of PHP in Xampp

Postby alicemcline » 14. July 2009 14:42

ok thanks it worked..
now i wonder how to configure Dreamweaver to stop saving with Byte-order Mark.. :?
alicemcline
 
Posts: 10
Joined: 10. July 2009 06:56


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 54 guests