When php uses the session prompt [function. session-start]: open Solution _ PHP Tutorial

Source: Internet
Author: User
When php uses the session prompt [function. session-start]: open solution. When using php for background management, the user logon page will prompt Warning: session_start () [function. session-start]: open... is incorrect, followed by failed: Nosuchfileordirec.

When using php for background management, the user logon page will prompt Warning: session_start () [function. session-start]: open... the error is followed by failed: No such file or directory. This tells us that the directory is not saved. next I will introduce the problem solution to you.

For example, in my test 111. php file, the following code is provided:

Session_start ();
$ _ SESSION ['admin'] =_ _ POST ['username'];
?>

Run code prompt

Warning: session_start () [function. session-start]: open (/empty, O_RDWR) failed: No such file or directory (2) in E: webhtdocswww.111cn. net111.php on line 9

From the error message above, the following error message is displayed: failed: No such file or directory. it indicates that the directory to be written in the session cache cannot be found, so that I can see the cause.

Solution

The SESSION file storage directory does not exist. Just create one.
View PHP. INI
Session. save_path =/tmp

Change it to the path you want to save, such as session. save_path = "E:/server/php5/session_temp"

Restart the server.

Invalid session_start () [function. session-start]: open... error, followed by failed: No such file or direc...

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.