Home > Backend Development > PHP Tutorial > PHP error WARNING: SESSION_START() [FUNCTION.SESSION-START] solution_PHP tutorial

PHP error WARNING: SESSION_START() [FUNCTION.SESSION-START] solution_PHP tutorial

WBOY
Release: 2016-07-13 10:30:47
Original
1052 people have browsed it

When doing development, you sometimes encounter this problem when operating sessions: Warning: session_start() [function.session-start]......

PHP environment:
OS: CentOS release 5.2 (Final)
Apache:
Server version: Apache/2.2.3
Server built: Jan 15 2008 20: 33:30
php:
PHP 5.1.6 (cli) (built: May 24 2008 14:07:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2. 1.0, Copyright (c) 1998-2006 Zend Technologies

The error message is as follows:

Copy the codeThe code is as follows:

Warning:session_start() [function.session-start]:open(/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR) failed:Permission denied(13)in www_path on line 9
Warning:Unknown:open(/var/lib/php /session/sess_itqfqua1554rmkgcb8u89ujem5,O_RDWR)failed:Permission denied(13)in Unknown on line 0
Warning:Unknown:Failed to write session data (files);Please verify that the current setting of session.sav_path is correct (/var /lib/php/session)in Unknown on line 0

Solution:
Method 1. Comment out
session.save_path = “/var/lib/php/session” in /etc/php.ini
Method 2, View the apache user and group, and then add the user to the group where the session folder is located.
Method 3, don’t have any output before session_start()!
Then restart Apache;
OK, the problem is solved!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/764622.htmlTechArticleWhen developing, sometimes you will encounter this problem when operating the session: Warning: session_start() [function.session -start]... PHP environment: OS: CentOS release 5.2 (Final) Apache: Server...
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