Home > Backend Development > PHP Tutorial > PHP uses session prompt [function.session-start]: open solution_PHP tutorial

PHP uses session prompt [function.session-start]: open solution_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 10:26:54
Original
954 people have browsed it

When using php for background management, the user login page will prompt Warning: session_start() [function.session-start]: open... error, followed by failed: No such file or directory. This tells us that the directory no longer exists. Let me introduce the solution to the problem

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

session_start();
$_SESSION['admin'] =$_POST['username'];
?>

Run code tips

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

From the error message above, there is a failed: No such file or directory prompt, which tells me that the directory where the session cache is to be written cannot be found, so I know the reason

Solution

The SESSION file saving directory does not exist. Just build one. 
View PHP.INI
session.save_path = /tmp

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

Just restart the server.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/822511.htmlTechArticleWhen using php for background management, the user login page will prompt Warning: session_start() [function.session -start]: open... error, followed by failed: No such file or direc...
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template