Vidyadhar Posted August 24, 2013 Share Posted August 24, 2013 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. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted August 24, 2013 Share Posted August 24, 2013 on your windows development system, go into your php.ini and turn output_buffering OFF so that the code you develop will work without relying on one of php's non-portable short-cuts. Quote Link to comment Share on other sites More sharing options...
PravinS Posted August 24, 2013 Share Posted August 24, 2013 you can put session_start() at top of your page Quote Link to comment Share on other sites More sharing options...
Vidyadhar Posted August 24, 2013 Author Share Posted August 24, 2013 Thanks for the replies. Problem is not that I am using WIndows system, in fact I was hosting and developing on the Windows previously and now both are on Linux. But I don't know why same php script now not working on Linux. I think some setting is required to make session_start work properly but I don't know what exactly it is. @PravinS, session_start is on the top already. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted August 24, 2013 Share Posted August 24, 2013 if you post the important part of the error message (the line number where the output is occurring at), it will help someone to help you with what is causing the problem. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.