PHP session_start of about Cannot send session cache limiter headers already sent error resolution

  • 2020-03-31 17:08:12
  • OfStack

Say there have been output, with a editor, clearly what all have no, in front of the original at the time of using AJAX, also seen this kind of situation, then put the PHP files in the Linux open, will find that, in the front of the file, there will be a "nobelium" such a character (quotes), remove it, to run again, OK, normal operation. Later, I searched some files on the Internet and explained that the BOM (Byte Order Mark) Mark of UTF8 file would be automatically saved when saved!
No matter what it is, the purpose now is to get rid of it, I have summarized the following three methods:
1. Open it under Linux, remove it and save it
2. Open it with a clipboard, press the cursor back and forth, then delete, and return to the first line so that the first character is removed
3, use application UltraEdit editor (useful an editor, online, oneself down), open advanced Unicode/utf-8, configuration, testing, to automatically detect utf-8 documents, automatic detection without BOM Unicode file in front of the hook all take out, and then you open that file, will find the character "nobelium" appeared, delete with respect to OK


Dumb: do you do this with lots of pages?
Set OB_START() directly at the beginning of the PHP page. You can solve it!

Solutions:
Change session.auto_start = 0 to session.auto_start = 1 in php.ini
Output_buffering = change to on or any number.
And don't forget to reboot...

Related articles: