PHP hint failed to write session data error resolution, failedsession_php tutorial

Source: Internet
Author: User

PHP prompt failed to write session data error resolution, Failedsession


In this paper, the resolution of PHP hint failed to write session data error is analyzed in detail. Share to everyone for your reference. Here's how:

First, the question:

Hint message:warning:failed to write session data (files). Verify the current setting of Session.save_path was correct () in Unknown on line 0

Second, the solution:

The code is as follows: copy code code as follows: Session.save_path = "D:/phprun/tmp"

This is a custom folder to point to the error caused by default, the system does not appear, and sometimes it is possible that the directory does not write permissions, so everyone gives permission to.

Because of PHP's working mechanism, it does not have a daemon thread to periodically scan the session information and determine whether it is invalid, when a valid request occurs, PHP will be based on global variables session.gc_probability and SESSION.GC_ The value of divisor to determine whether a GC is enabled, by default, Session.gc_probability=1, session.gc_divisor = 100 which means there is a 1% possibility to start the GC ( This means that only one GC in 100 requests starts with one of the 100 requests.

PHP garbage collection mechanism is to scan all the session information, with the current time minus the last time the session was modified, compared with the session.gc_maxlifetime parameter, if the survival time exceeds gc_maxlifetime (default 24 minutes ), the session is deleted.

However, if your Web server has multiple sites, multiple sites, GC processing sessions can have unexpected results because the GC does not differentiate between sessions at different sites when it is working.

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/929091.html www.bkjia.com true http://www.bkjia.com/PHPjc/929091.html techarticle PHP hint failed to write session data error resolution method, failedsession this article in more detail analysis of the PHP prompt failed to write session data error resolution. To share with you ...

  • 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.