First, write down the solution, so the solution is to delete the output. Specifically, you do not need to modify any php. ini, write ob_start (), or cache headers, and call ob_end_clean () directly before session_start. Original Author: surance # gmail.com (replace # With @) followed by the solution steps
First, write down the solution, so the solution is to delete the output. Specifically, you do not need to modify any php. ini, write ob_start (), or cache headers, and call ob_end_clean () directly before session_start. Original Author: surance # gmail.com (replace # With @) followed by the solution steps
First, write down the solution.
Therefore, the solution is to delete the output from the head.
Specifically, you do not need to modify any php. ini, write ob_start (), or cache headers. You can directly call one sentence before session_start.
Ob_end_clean ()
You can.
Original Author: surance # gmail.com (replace # @)
The solution is as follows:
After switching from phpnow to xampp, there are many problems (the main problem with phpnow is that zend_extention_ts cannot be installed, and the path line is too small to be installed .).
It took a lot of time to solve these problems and learned a lot.
Here we will record how to solve the session_start problem.
If no output is written, the headers already sent error is returned.
Some people talk about modifying the configuration file on the Internet, and some about modifying the configuration file.
Output_buffering = On
In this way, the header file cache is not output for the time being; some say that the session auto start is directly set to On, and some people close the error without any margin.
In fact, I have tried the first two methods. However, if the web page does not use a session, it is not a loss to enable it by default. In addition, it is hard to say whether all header caches have problems.
So what are the output characters before session_start? It can be called before session_start.
Var_dump (headers_list ());
To view.
I found that there are two output types, X-PoweredBy: And Content-Type. Changing the expose_php = off of PHP. ini can disable x-poweredBy, but I don't know how to disable the output content-type.
However, I know these two are useless.
Therefore, the solution is to delete the output from the head.
Specifically, you do not need to modify any php. ini, write ob_start (), or cache headers. You can directly call one sentence before session_start.
Ob_end_clean ()
You can.
You can call ob_start () in php code to cache head output.