Help! with sessions

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
mickey
-


Joined: 09 Dec 2002
Posts: 25

PostPosted: Thu Feb 27, 2003 2:21 pm    Post subject: Help! with sessions Reply with quote

I have been trying for days to get sessions to work on my server, can someone please help me? I have tried all the solutions metioned in the forum, and have read the manual on php.net, but nothing seems to be working.

This is the code:
Quote:
<?
session_start();
$msg = "started a session....";
?>
<html>
<head>
<title>Start a Session</title>
</head>
<body>
<? echo "$msg"; ?>

</body>
</html>

the problem is that I keep getting this message:
Quote:
Warning: open(/tmp\sess_c2ce1c72ccf070d1f60ee60bf0030e75, O_RDWR) failed: No such file or directory (2) in C:\Program Files\Abyss Web Server\htdocs\session.php on line 2
started a session....
Warning: open(/tmp\sess_c2ce1c72ccf070d1f60ee60bf0030e75, 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

(yes I have made sure that there is actually a file called 'c:\Program Files\Abyss Web Server\tmp'. I have also tried to point the file to several different places. And no the file is not write protected.)

And this is the setting in my php.ini file:
Quote:

[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 = c:\Program Files\Abyss Web Server\tmp

; Whether to use cookies.
session.use_cookies = 1


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

; Initialize session on request startup.
session.auto_start = 1

; Lifetime in seconds of cookie or, if 0, until browser is restarted.
session.cookie_lifetime = 0

; The path for which the cookie is valid.
session.cookie_path = c:\Program Files\Abyss Web Server\tmp

; The domain for which the cookie is valid.
session.cookie_domain = localhost


Any help much appreciated :?
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Feb 28, 2003 12:54 am    Post subject: Re: Help! with sessions Reply with quote

c:\Program Files\Abyss Web Server\tmp should be a directory path. That means that you must create an empty directory in c:\Program Files\Abyss Web Server\ and call it tmp.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
mickey
-


Joined: 09 Dec 2002
Posts: 25

PostPosted: Fri Feb 28, 2003 1:53 am    Post subject: Reply with quote

I have done this...
Back to top View user's profile Send private message
rIkLuNd
-


Joined: 15 Jan 2003
Posts: 25
Location: Örebro, Sweden

PostPosted: Mon Mar 17, 2003 12:43 am    Post subject: Reply with quote

Well, if you create a php page with session_start() in it, and open it in the browser, and before you close down the window and go to the dir and check if there are any session files there. If not, then try and create a folder called "tmp" under C:\ (or whatever your harddrive is called). My session folder is under C:\tmp
Back to top View user's profile Send private message Send e-mail MSN Messenger ICQ Number
vbgunz
-


Joined: 02 Feb 2003
Posts: 615
Location: Florida

PostPosted: Mon Mar 17, 2003 3:01 am    Post subject: Reply with quote

Yup, You dont have a tmp or temp folder created before running the script. I am not too intelligent when it comes to php but I ran into so many session.save_path errors before...

You need to tell the script where exactly the tmp folder you wish to use is located... You can use an absolute path but if you wish to use a relative path again you have to make sure the folder is already created.

For example the script your using is looking for /tmp\sess_c2ce1c72ccf070d1f60ee60bf0030e75

Since that is a relative path (doesn't have a c:\, etc) is their a "tmp" folder located within the directory where the script is located?

Change that line to an absolute system path where a tmp folder does exist (create one if necessary) and see what happens.

Overall, in the end the tmp folder simply does not exist, check to make sure the paths are correct and all should be well. Good luck :)
_________________
Victor B. Gonzalez
http://aeonserv.com
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
mickey
-


Joined: 09 Dec 2002
Posts: 25

PostPosted: Mon Mar 17, 2003 5:08 pm    Post subject: Reply with quote

Thanks guys for answering :) But that was quite an old post...I figured out the problem in the end. I did have a folder called 'tmp' and all my session and cookie settings were fine, the problem was with the 'upload_tmp_dir' configuration in my php.ini file, which was not set. I just directed it to my tmp folder and that seemed to work for me.

Just in case anyone else is having the same trouble:

;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = c:\Program Files\Abyss Web Server\tmp

; Maximum allowed size for uploaded files.
upload_max_filesize = 2M


I now receive sessions but have a whole other set of problems trying to configure my browser to accept them properly...
Back to top View user's profile Send private message
vbgunz
-


Joined: 02 Feb 2003
Posts: 615
Location: Florida

PostPosted: Tue Mar 18, 2003 8:09 am    Post subject: Reply with quote

Cool, I am happy you solved it :)
_________________
Victor B. Gonzalez
http://aeonserv.com
Back to top View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group