Page 1 of 1

Warning: Unknown(): open Sessions Error

Posted: Fri Feb 02, 2007 1:42 am
by SoreE yes
I am attempting to use sessions for the first time. Several messages came up:

Code: Select all

Warning: session_start() [function.session-start]: open(/tmp\sess_d576867242626e2f4fd098890b8790bf, O_RDWR) failed: No such file or directory (2) in c:\appserv\www\test\page1.php on line 3
Go to this page
Warning: Unknown(): open(/tmp\sess_d576867242626e2f4fd098890b8790bf, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): 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 the php.ini file there appear a number of items that could be changed.

Code: Select all

[Session]
; Handler used to store/retrieve data.
session.save_handler = files

; 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 = /tmp   

; Whether to use cookies.
session.use_cookies = 1

; This option enables administrators to make their users invulnerable to 
; attacks which involve passing session ids in URLs; defaults to 0.
; session.use_only_cookies = 1

; Name of the session (used as cookie name).
session.name = PHPSESSID

; Initialize session on request startup.
session.auto_start = 0
It says Windows users will have to change a variable, but it doesn't say what to change it to. And do I need to create a new file/folder. Full file paths would help. Being an ex Mac user I'm still in awe of the number of folders Windows manages to spawn. I'm afraid I'm out of my depth with this. Help much appreciated.

Posted: Fri Feb 02, 2007 9:08 am
by feyd
The path to the session.save_path must exist and be writable for PHP.

Path chosen

Posted: Fri Feb 02, 2007 8:10 pm
by SoreE yes
Thank you for your response. I have simply created a file on my hard drive, c:/tmp. It works fine now. Obviously it has set it's own path and is writable. Many thanks.