Problem with XAMPP

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

Problem with XAMPP

Postby krazframe » 11. December 2005 03:03

Hey, fist let me say XAMPP is a great idea! Makes installing a server much easier.
I recently got a new server and needed to transfer my website over. So I downloaded and installed XAMPP because I liked the idea of an all in one package.
After I tranfered my MYSQL and http/php files I ran the server
My pages are displayed, but on my main page, where I have a blogg, I am reciving this error right where I include the blog php


//

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\apache\xampp\htdocs\index.html:8) in C:\Program Files\apache\xampp\htdocs\index.php on line 28

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\apache\xampp\htdocs\index.html:8) in C:\Program Files\apache\xampp\htdocs\index.php on line 28

//

I never had this problem on my old server, which was apache 2, with php 5.05

My main page is an index.html with the blogg, index.php, included in it.

Does anybody have any idea as to why this is happening?
Board? Check out KrazFrame Humor! For free games, funny pictures and Crazy Videos!
krazframe
 
Posts: 3
Joined: 11. December 2005 02:54

more info

Postby krazframe » 11. December 2005 11:11

Well, I've been playing around with it a bit and found sompthing rather peculiar,

if i make an html file with the code

/////////////////////////////////////////////
<?php include("index.php"); php?>
/////////////////////////////////////////////

I don't get the error. ( that is not including the /'s)
If I make an html file with the code

/////////////////////////////////////////////

<?php include("index.php"); php?>
/////////////////////////////////////////////

I do get the error. Notice the space before the php
And if I make a file with the code

/////////////////////////////////////////////
<html><?php include("index.php"); php?>
/////////////////////////////////////////////

I get the error. It looks like every time I put anything before index.php I get an error. Anybody know whats going on?
Board? Check out KrazFrame Humor! For free games, funny pictures and Crazy Videos!
krazframe
 
Posts: 3
Joined: 11. December 2005 02:54

Postby cj_nza » 11. December 2005 21:42

If your blog uses cookie bases sessions - this is expected PHP behaviour.

You cannot send browser output and afterward try to modify the header (cookie session data).

Hence your error informing you of this.

You should not send any data to the browser prior to calling the session_start function.

See the session_start function on php.net
cj_nza
 
Posts: 53
Joined: 06. September 2005 11:49

Postby Wiedmann » 13. December 2005 13:18

I get the error. It looks like every time I put anything before index.php I get an error. Anybody know whats going on?

That's the desired behaviour. See the PHP-manual about sessions.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Alternatively

Postby eXcalibur_lk » 05. January 2006 01:16

You could wrap your include in ob_start() and ob_end_flush() also, this will execute all php code within the two functions before it outputs any html.

Read the PHP Manual for more details.
eXcalibur_lk
 
Posts: 3
Joined: 05. January 2006 00:44


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 35 guests