Home > Backend Development > PHP Problem > Error when php uses session

Error when php uses session

Release: 2023-02-27 20:56:01
Original
4255 people have browsed it

Error when php uses session

1. The error reported when PHP uses session is as follows:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent

Solution:

1. Change output_buffering=off in php.ini to output_buffering=4096

2. Change output_buffering=off in php.ini Is session.save_path set up?

3. Change session.auto_start = 0 in pgp.ini to session.auto_start = 1

4. PHP code session_start( ) There must be no output before it, and it must be placed on the first line; any characters before the PHP code of session_start() are regarded as headers. That is, put session_start();......?> at the beginning of the file, and there cannot be any characters in front of

If the above four methods cannot solve the problem, you can use UltraEdit-32 Save it as UTF-8.

2. The error reported when PHP uses session is as follows:

Warning: session_start(): Cannot start session when headers already sent in

Warning: Cannot modify header information - headers already sent by (output started at

The error reported here is that there are extra spaces, as shown below.

Error when php uses session

Remove the extra spaces and you can .

Error when php uses sessionRecommendation:php server

The above is the detailed content of Error when php uses session. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template