Page 1 of 1

servers php.ini

Posted: Thu Mar 08, 2007 12:05 pm
by Bandy
Hi

Ive been writing program and using session_start().
The program on apache web server locally works fine, but when i uploaded to internet server the message appears:
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home...
I think this is problem with servers php.ini, but i talked with host support and it seems to me that they don't know what to do .

Can you tell me is the problem in servers php.ini and what to do, or is a problem in different nature.

Thanks a lot!

Posted: Thu Mar 08, 2007 12:08 pm
by Chris Corbyn
Nothing to do with the server. Your code has something that's output to the browser before you've called session_start(). session_start() send some HTTP headers to the browser, but if output has already started it's too late to send headers.

NOTE that even whitespace counts as output if it's before the opening <?php tag.

Posted: Thu Mar 08, 2007 12:32 pm
by Bandy
ive put session_start() near by <?php session_start() and now it seems ok!

Thanks a lot man!