PHP error Warning:session_start () [FUNCTION. Session-start] Solutions _php Tips

Source: Internet
Author: User
Tags php error zend

When doing development, the operation session sometimes encounters this problem: Warning:session_start () [Function.session-start] ...

System Environment: win2003+iis6+php5.2.12

PHP appears similar to the following error:
Warning:session_start () [Function.session-start]: ... failed:no such file or directory ... and other circumstances,
You can try it. Change the Session.auto_start = 0 in the php.ini file to Session.auto_start = 1
If the problem persists after restarting IIS,
That is, the session variable requires the system's temporary file space and requires read and write permissions.
Find Session.save_path in php.ini =, set a valid folder path,
For example: Session.save_path = "C:\php5\session_temp" and add permissions to the folder so that everyone has permission to modify the write.

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 Code code as follows:

Warning:session_start () [Function.session-start]:open (/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,o_ RDWR) Failed:permission denied (Www_path on line 9
Warning:Unknown:open (/VAR/LIB/PHP/SESSION/SESS_ITQFQUA1554RMKGCB8U89UJEM5,O_RDWR) Failed:permission denied (a) in Unknown on line 0
Warning:Unknown:Failed to write session data (files); Please verify this current setting of Session.sav_path is correct (/var/lib/php/session) in Unknown on line 0

Solution:
Method 1, comment out the/etc/php.ini
Session.save_path = "/var/lib/php/session"
Method 2, view the Apache users and groups, and then add the user to the group where the session folder is.
Method 3, do not have any output before session_start ()!
then restart Apache;
OK, problem solved!

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.