Home  >  Article  >  Backend Development  >  Warning: session_start() [function.session-start]_PHP教程

Warning: session_start() [function.session-start]_PHP教程

WBOY
WBOYOriginal
2016-07-13 10:57:06920browse

Friends who can use sessions often encounter the Warning: session_start() [function.session-start] error message. This problem is actually that there is data input before the session. The solution is very simple. I will give it to you below. Summarize.

Error message in 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 there is output in front

Solution:

Modify session.auto_start = 0 in php.ini to session.auto_start = 1
output_buffering = change 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: Check the apache user and group, and then add the user to the group where the session folder is located.
Method 3, do not have any output before session_start()!


Error message 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 temporary space in the system

session.save_path = "Set the absolute path to a valid folder"

(for example session.save_path = "C:WINDOWStemp" )

session.save_path =Remove the ' ; ' sign in front

In addition, add EVERYONE with permission to edit the folder and have write and modify permissions!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632131.htmlTechArticleFriends who can use session often encounter the error message Warning: session_start() [function.session-start] Yes, this problem is actually that there is data input before the session. How to solve it...
Statement:
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