PHP use session prompt [Function.session-start]: Open Solution

Source: Internet
Author: User
When using PHP to do background management will encounter the user login page will prompt Warning:session_start () [Function.session-start]: Open ... Error, followed by failed:no such file or directory, this is to tell us that the directory is not saved, let me introduce you to the problem solution

For example, our test 111.php file has the following section of code

?
Session_Start ();
$_session[' admin '] =$_post[' username '];
?>

Running Code hints

Warning:session_start () [Function.session-start]: Open (/tmpsess_84cb589ea249708b09c3d5e6836fdd0d, O_RDWR) failed: No such file or directory (2) in e:webhtdocswww.111cn.net111.php to line 9

From the above error tip is a failed:no such file or directory hint, is to tell me that the session cache to write the directory, so I know why

Solutions

The session File save directory does not exist. Build one on the line.
View in PHP.ini
Session.save_path =/tmp

Change to the path you want to save as Session.save_path = "E:/server/php5/session_temp"

Reboot the server.

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.