How to resolve Error Warning:session_start () [FUNCTION] on PHP. Session-start]

Source: Internet
Author: User
Tags php error
This article mainly introduces PHP error Warning:session_start () [FUNCTION. Session-start] solution, need a friend can refer to the next

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

System Environment: win2003+iis6+php5.2.12

PHP appears with an error similar to the following:
Warning:session_start () [Function.session-start]: ... failed:no such file or directory ... and other circumstances,
You can try it. Session.auto_start = 0 in the php.ini file is changed to Session.auto_start = 1
If the problem persists after restarting IIS,
That is, the session variable requires a temporary file space for the system and requires permission to read and write.
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:

Warning:session_start () [Function.session-start]:open (/var/lib/php/session/sess_itqfqua1554rmkgcb8u89ujem5,o_ RDWR) Failed:permission denied (+) in Www_path on line 9warning:unknown:open (/var/lib/php/session/sess_ ITQFQUA1554RMKGCB8U89UJEM5,O_RDWR) Failed:permission denied (+) in Unknown on line 0warning: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

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

The above is the whole content of this article, I hope that everyone's learning has helped, more relevant content please pay attention to topic.alibabacloud.com!

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.