Web Hosting Talk







View Full Version : a php error problem


omegagz
12-21-2004, 05:26 AM
hi. a few of my webhost clients are having 1 same issue with their site or script. here is the error message that i see.

Warning: Cannot modify header information - headers already sent by
Warning: session_start(): Cannot send session cache limiter - headers

a friend tolf me this problem can be fixed by editing a line under php.ini . is that right? and if yes can anyone tell me which line ( please be exact) to edit and to what. thx

dmxo
12-21-2004, 05:37 AM
I don't think it's a server problem, please check the code.
PHP says you already sent some headers, if your code is initializing sessions after any part of HTML is sent, then the problem is the code.
Otherwise, if the code is correct and works fine somewhere else, then it could be the PHP.ini or anything else.
HTH

Rich2k
12-21-2004, 06:50 AM
Sounds like you've already sent something out to the browser before executing your session_start(); Note carriage returns and white space count

e.g.


Text
<?php

session_start();
?>


The above would cause the error you see but the following wouldn't... simply because there is some text or a carriage return before the opening PHP tag.


<?php

session_start();
?>

spamtuning
12-23-2004, 08:12 AM
Hits a server problem i think to

Marble
12-23-2004, 01:24 PM
If you don't actually know the problem, then don't answer with misleading information.

That is a common error that occurs when you try to send header information AFTER you output the page. You need to look into ob_start() and ob_end() and the other functions associated with buffer handling...