Why session_start is giving warning

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 1
Joined: Sat Aug 24, 2013 3:13 am

Why session_start is giving warning

Postby Vidyadhar » Sat Aug 24, 2013 4:18 am

I had built my website in php, earlier on Windows platform and amply used session_start function. Later I shifted to Linux hosting and realized that each session_start is displaying a warning that headers already sent etc. Now I searched google and came to know that this problem comes when BOM or any other char has been sent prior to session_start. But BOM is inevitable in my case as it is a multilingual website. Now i came to know that changing php5.ini and setting some option may help avoid the problem but since this is a shared hosting, i had to search for how to set my own php.ini, i found too, but unfortunately php.ini options are also not taking effect (this is checked by using phpinfo function). Can somebody please help rescue the situation? Thanks for reading this.

php-forum Super User
php-forum Super User
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Why session_start is giving warning

Postby johnj » Tue Aug 27, 2013 7:55 pm

1).check if you have a white space before <?php

2).please read about ob_start() and if found useful, then try to use it at the top of the page

Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 6 guests