...

View Full Version : can't create a session



x_goose_x
03-11-2003, 03:03 AM
I set up a simple script that contained:


<?php
session_start();
?>

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?

Jason
03-11-2003, 03:24 AM
did you call session_name() before you start?

here is the call in the php page.
http://www.php.net/manual/en/function.session-start.php
you might want to read the notes below there too.


Jason

Spookster
03-11-2003, 05: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.

x_goose_x
03-11-2003, 03:13 PM
tried a web-accessible and one right above the root. Neither worked.

firepages
03-11-2003, 06:36 PM
you got XP ?

if so create a C:/tmp directory , XP seems to ignore the sesion_save_path sometimes ?

x_goose_x
03-11-2003, 07:25 PM
That was the prob. Thanks a lot.

I'm running win2k server.

firepages
03-11-2003, 07:37 PM
2K! , ok - I only ever seen it happen on XP before but interesting to know.

optimism_
03-11-2003, 08: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

firepages
03-12-2003, 04: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.

x_goose_x
03-12-2003, 05:08 AM
Lucky me.

optimism_
03-12-2003, 11: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)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum