PHP session_start () about cannot send session cache Limiter-headers already error

Source: Internet
Author: User

Change the DW to the default encoding of UTF-8 charset and compiler encoding .Programming under Windows, when using the Session_Start () method, is sometimes reported session_start () [Function.session-start]: Cannot send session cache limiter- Headers already sent (output started at/var/www/inpublisher/php1.php:1) The error is that there is already output, with the editor to play, the front obviously nothing, originally in the use of Ajax, Also have this situation, later, put this PHP file into Linux Open, will find that at the top of the file, will appear "nobelium" such a character (in quotation marks), remove it later, then run, OK, run normally. Later on the Internet to search for some files, the explanation is: UTF8 file BOM (Byte Order mark) flag, when saved will be automatically deposited!
Whatever it is, the goal now is to get rid of it, and I'll summarize the following three ways:
1, open under Linux, remove and then save
2, open with WordPad, put the cursor to the front and rear carriage return, and then knock Delete, back to the first line, so that the front of the character will be removed
3, using the UltraEdit editor (a very useful editor, on-line more is, their own down), open the Advanced----configuration----unicode/utf-8 detection, automatically detect UTF-8 files, automatic detection of non-BOM Unicode files, such as the front of the hook all removed, Then you open that file, you will find that the "nobelium" character appears, delete is ok


Stupid method: Do you do this when there are a lot of pages?
In the PHP page header directly set Ob_start ();, you can solve!

Workaround:
Modify Session.auto_start in php.ini = 0 = Session.auto_start = 1
output_buffering = change to On or any number.
Then don't forget to restart ...

PHP session_start () about cannot send session cache Limiter-headers already error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.