When you run the PHP page, the following error occurs: "Cannot send session cache limiter-headers already sent by ()" or "function session_start ()", which is a headache. This is not the first time. To help you better understand the problem, write down the cause analysis and solution in detail and share it with you.
Problem analysis:
I remember that when I first encountered this problem, Google had a lot of answers and many solutions, but most of the root causes of this problem were: when running session_start (); there is no output, and the page has been empty line, or can be said that the page is a UTF-8 page containing DOM encoding.
Check whether the page contains DOM encoding methods:
1. Use the Dreamweaver software to open the page, view the page attributes (modify-page attributes-title/encoding), and check whether the "include Unicode signature BOM" item is checked;
2, notepad open, save as, the encoding format for ANSI does not contain DOM, if the UTF-8, basic certainly contain.
Solution:
Remove the DOM line by using tools such as editplus and ultraedit. The specific steps are as follows:
Step: open the page through UE-file-save as-format select UTF-8 without BOM-save, that is, the UTF-8 page goes to the BOM header, no blank lines of the page header will appear.
As shown in the following figure:
Other solutions:
1. Add ob_start () to the page header; // occasionally, it becomes invalid;
2, new page, COPY the code in the past, this method sometimes works, pay attention to GBK or UTF-8 encoding (usually by GBK as UTF-8 encoding will default with DOM encoding );
3. In another case, the server PHP configuration problem: modify session. auto_start = 0 in php. ini to session. auto_start = 1;
4. Basically, this problem can be solved. There are still some unconventional methods that are rare. If they cannot be solved, you can only Google.