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.