View Full Version : can't create a session
03-11-2003, 02:03 AM
I set up a simple script that contained:
And I get the following error:
Warning: open(/tmp\sess_09c2efaf81f7bbfdc44cbb876c0ad4b3, O_RDWR) failed: No such file or directory (2) in c:\fireserv\www\sessions\sess_start.php on line 2
Warning: open(/tmp\sess_09c2efaf81f7bbfdc44cbb876c0ad4b3, O_RDWR) failed: No such file or directory (2) in Unknown on line 0
Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
In my php.ini I have:
session.save_path = c:\WINNT\Temp
This path does exist. Can anyone tell me why I'm getting an error?
03-11-2003, 02:24 AM
did you call session_name() before you start?
here is the call in the php page.
you might want to read the notes below there too.
03-11-2003, 04:08 AM
Have you tried creating your own temp directory verses using the same temp directory your O/S is using? Create a temp directory one directory up from your web root directory(in other words a non-web-accessible directory) and see if it works.
03-11-2003, 02:13 PM
tried a web-accessible and one right above the root. Neither worked.
03-11-2003, 05:36 PM
you got XP ?
if so create a C:/tmp directory , XP seems to ignore the sesion_save_path sometimes ?
03-11-2003, 06:25 PM
That was the prob. Thanks a lot.
I'm running win2k server.
03-11-2003, 06:37 PM
2K! , ok - I only ever seen it happen on XP before but interesting to know.
03-11-2003, 07:18 PM
In the php.ini file, in the comment above the session.save_path setting for sessions says:
; Argument passed to save_handler. In the case of files, this is the path
; where data files are stored. Note: Windows users have to change this
; variable in order to use PHP's session functions.
session.save_path = C:\PHP\tmp\
By default, this is empty. When I tried to use sessions, i got the same error, but they ceased as soon as i set this setting. It would appear necessary for ALL versions of windows
03-12-2003, 03:34 AM
optimism_ , its true you have to set this in the php.ini however for some reason with PHP on windows XP (& only sometimes ?) this path is ignored and only C:\tmp will actually work
I had never seen this behaviour on win2k b4 though.
03-12-2003, 04:08 AM
03-12-2003, 10:14 PM
I [i]am[/] running windows XP, and have set the temp dir to a subdir of my web root on a D: partition, i can see the session files so i know it is saving to this location - It didnt work before this setting was changed though - maybe its a very obscure bug
(running php 4.2.3 on winxphome with KFWS)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.