servers php.ini

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
User avatar
Bandy
Forum Newbie
Posts: 22
Joined: Sat Oct 21, 2006 5:14 am
Location: Croatia

servers php.ini

Post 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!
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
Bandy
Forum Newbie
Posts: 22
Joined: Sat Oct 21, 2006 5:14 am
Location: Croatia

Post by Bandy »

ive put session_start() near by <?php session_start() and now it seems ok!

Thanks a lot man!
Post Reply