You do not need to modify configuration files such as php. ini to fix the session.

Source: Internet
Author: User
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.

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.