Warning: Unknown(): open Sessions Error

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
SoreE yes
Forum Commoner
Posts: 32
Joined: Wed Oct 11, 2006 3:59 am

Warning: Unknown(): open Sessions Error

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

The path to the session.save_path must exist and be writable for PHP.
SoreE yes
Forum Commoner
Posts: 32
Joined: Wed Oct 11, 2006 3:59 am

Path chosen

Post 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.
Post Reply