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

Source: Internet
Author: User
Tags php error

During development, this problem occurs sometimes when session operations are performed: 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 codeThe Code is as follows:
Warning: session_start () [function. session-start]: open (/var/lib/php/session/reset, O_RDWR) failed: Permission denied (13) in www_path on line 9
Warning: Unknown: open (/var/lib/php/session/sess_it1_qua1554rmkgcb8u89ujem5, 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/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!
Restart Apache;
OK, solve the 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.