cybercrypt13 Posted April 3, 2006 Share Posted April 3, 2006 We had a website that worked perfectly up until Friday. Since Friday when we open a page we get the following error. No code changes within the site took place so this has to be some sort of configuration problem but I don't know what.Can any help?Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/softekso/public_html/tbamu/functions.php:68) in /home/softekso/public_html/tbamu/main/body_header.php on line 2Thanks Quote Link to comment https://forums.phpfreaks.com/topic/6474-problems-with-php-sessions/ Share on other sites More sharing options...
wildteen88 Posted April 3, 2006 Share Posted April 3, 2006 It is becuase something has been outputted near line 68 in functions.php and body_header.php is starting a session around line 2. Quote Link to comment https://forums.phpfreaks.com/topic/6474-problems-with-php-sessions/#findComment-23478 Share on other sites More sharing options...
cybercrypt13 Posted April 3, 2006 Author Share Posted April 3, 2006 Thats not an answer but a restatement of the obvious. As I stated, nothing has changed in our source code so I don't see how it could possibly have problems. Something has changed in the configuration on the server somewhere that has caused this problem. its the only thing that makes sense. I've checked the global property in php.ini and its turned on.However, there are more than one php.ini file. Can anyone tell me how to determine which one is being used by php?THanks, Quote Link to comment https://forums.phpfreaks.com/topic/6474-problems-with-php-sessions/#findComment-23491 Share on other sites More sharing options...
cybercrypt13 Posted April 3, 2006 Author Share Posted April 3, 2006 I need to clarify a few things now that I better understand the problem.I have a function.php that stores a bunch of functions one of which connects to the db. This function accesses a session var to determine the name of the db and its always worked perfectly for years.Now, upon trying to access the sessionvar it is finding it to be an empty string, despite the fact that the variable exists on other pages. I have the session_start(); line as the only line directly after <? and again, none of this code has changed so it has to be something on the server thats caused this to act this way.Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/6474-problems-with-php-sessions/#findComment-23508 Share on other sites More sharing options...
thirdearth Posted December 18, 2008 Share Posted December 18, 2008 Usually that issue, at least in my experience, is because you are sending a header function after something else is already being outputted. All header functions have to be processed before any code *even blank space* can be outputted.http://us3.php.net/manual/es/function.header.phpThere are 2 ways that I know of to fix this. First one is to make sure that you are only using the header function at the top of all processed pages, before any other code is ran. The second, and easier, way to handle this is ob_start and ob_end_flush functions.http://us.php.net/ob_startIf you use those on the page, then everything between them will buffer before any code is outputted. As to why it just started happening, I can't tell you. Did anyone change your configuration of PHP? My guess is that there was some sort of error reporting option that was turned off before and someone turned on. I had the same issue when I swapped a PHP-driven site from a host to my personal web server and I used output buffering to fix it. Quote Link to comment https://forums.phpfreaks.com/topic/6474-problems-with-php-sessions/#findComment-719183 Share on other sites More sharing options...
thirdearth Posted December 18, 2008 Share Posted December 18, 2008 Wow, I just noticed that there was a sticky regarding this issue. Guess I should look around before I go posting replies that have probably been answered a thousand times. Quote Link to comment https://forums.phpfreaks.com/topic/6474-problems-with-php-sessions/#findComment-719186 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.