Warning: session_start () [function. session-start] _ PHP Tutorial

Source: Internet
Author: User
Warning: session_start () [function. session-start]. A friend who can use the session will often encounter Warning: session_start () [function. session-start] the error message is displayed. In fact, there is data input before the session. if you can solve this problem, some friends who can use the session will often encounter Warning: session_start () [function. session-start] the error message is displayed. The problem is that there is data input before the session. the solution is simple. I will summarize it for you.

Error message on my computer

Warning: session_start () [function. session-start]: Cannot send session cache limiter-headers already sent (output started at D: APMServ-v5.2.6APMServ5.2.6wwwhtdocsKingNerOAuserUserKqManage.php: 1) in D: APMServ-v5.2.6APMServ5.2.6wwwhtdocsKingNerOAusercheckaccess.php on line 2

The reason is that the previous output

Solution:

Modify session. auto_start = 0 in php. ini to session. auto_start = 1.
Output_buffering = changed to on or any number.

Solution in linux

Solution:

Method 1. comment out/etc/php. ini
Session. save_path = "/var/lib/php/session"
Method 2: view the apache user and group, and add the user to the group in which the session folder is located.
Method 3: do not have any output before session_start!


Error 2

Warning: session_start () [function. session-start]: Cannot send session cache limiter-headers already sent (output started at E: phpcodeadmin. php: 1) in E: phpcodelogolistadminlogo. php on line 2

That is, the session variable requires the temporary space of the system.

Session. save_path = "set the absolute path of a valid folder"

(For example, session. save_path = "C: WINDOWStemp ")

Session. save_path = remove the ';' sign.

In addition, you can add EVERYONE to edit the folder with write and modification permissions!

Session_start () [function. session-start] error message. this problem is actually caused by data input before the session. solve this problem...

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.