problem running with xampp??

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

problem running with xampp??

Postby haef » 13. December 2008 05:06

hello...

im a newbie...

i got problem when running my program on xampp

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\skripsiHasan\index.php:16) in C:\xampp\htdocs\skripsiHasan\olapCrosstab.php on line 2

but on wamp there is fine no warning ....why?


any body can help me please? i think there is problem with php.ini?

thx b4
haef
 
Posts: 5
Joined: 08. December 2008 11:02

Re: problem running with xampp??

Postby Sharley » 13. December 2008 06:06

I don't know anything about WAMP you would have to ask your question "why" at WAMP.



You have mixed php and html?

Your session php code goes before the html headers or else you will get this warning as the html headers have been sent first - for example:
Code: Select all
<html>
<head>
<title>Page title</title>
</head>

<body>

<?php
session_name ('name');
ini_set ('session.use_cookies', 0);
session_start();
?>



Change your code placement like this, and you should be fine.
Code: Select all
<?php
session_name ('name');
ini_set ('session.use_cookies', 0);
session_start();
?>

<html>
<head>
<title>Page title</title>
</head>

<body>

Also if you paste the code of your script here the troubleshooting can be more accurate, but I think you will get the idea...
...you have to make sure nothing gets sent to the browser before session_start();
Including white space.
http://www.php.net/manual/en/function.session-start.php
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: problem running with xampp??

Postby FeralReason » 19. September 2010 22:26

I am running XAMPP on Windows XP (WAMP) and I repeatedly get these errors:

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\test\test.php:1) in C:\xampp\test\test.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\test\test.php:1) in C:\xampp\test\test.php on line 2
Session value = 1

When I try to run a simple test file that contains nothing but this code:

<?php session_start(); ?>

Does anyone have a clue as to how this is being caused ?

Thanx !
Last edited by FeralReason on 18. December 2010 19:55, edited 1 time in total.
FeralReason
 
Posts: 19
Joined: 16. April 2009 20:42

Re: problem running with xampp??

Postby Altrea » 20. September 2010 05:04

Have you saved the file as UTF-8 with BOM (Byte Order Mark)?
The PHP Parser don't like BOMs so it sends the BOM directly to the browser.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 149 guests