Session.save_path setup

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Fixate
Forum Newbie
Posts: 1
Joined: Thu Apr 25, 2002 8:47 pm

Session.save_path setup

Post by Fixate »

I'm having trouble setting up the php.ini so that it has a proper save path for sessions.

it says in the ini "Note: Windows users have to change this
variable in order to use PHP's session functions."
session.save_path = /tmp

i'm on windows and i'm not sure where to direct the path.

ANy help on the matter would be great..... this is the error i getting when running a script.

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
User avatar
chiefmonkey
Forum Commoner
Posts: 25
Joined: Sat Apr 20, 2002 5:21 am
Location: Glasgow UK

Post by chiefmonkey »

What to do is create a folder on your hard drive to hold your session info, in my case it sits in my php folder. As an example let's say you are running WIN2K, and you create a folder within your WINNT folder and call it "session_data" without the quote marks then you simply map out the path to this folder in you php.ini which would be

session.save_path = c:/WINNT/session_data

restart apache just to make sure and that should be you

HTH

George
Craig
Forum Commoner
Posts: 37
Joined: Thu Apr 18, 2002 3:13 pm

Post by Craig »

just create the folder tmp = c: mp that's what I did!
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

The best place I have found it to create a folder called sessions or something in your php or logs directory (to keep it off ot the C:> and keep your computer clean) then just chenge the line to:

session.save_path=D:/httpd/php/sessions

BUt that is just MHO, I don't think that using the windows NT directory is a good idea atall, you shouldn't have temporary data being stored next to system files (paranoid I am).

Cheers Moe
User avatar
chiefmonkey
Forum Commoner
Posts: 25
Joined: Sat Apr 20, 2002 5:21 am
Location: Glasgow UK

Post by chiefmonkey »

sam wrote: BUt that is just MHO, I don't think that using the windows NT directory is a good idea atall, you shouldn't have temporary data being stored next to system files (paranoid I am).

Cheers Moe
I don't see what difference it makes, although I admit I'm not a windoze expert, but I am willing to listen as to why it shouldn't be done.

George
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

Well here is the way that I have always set up my windows nt/2000 servers. I create a partition or disk for the operating system. I create one for the database I have one for the web root and one for logs and temp data. If you put the sessions directory in the windows partition, with enugh hits your windows partition might become clogged and your entire wywtem will slow down. Just pesonal opinion.

Cheers Sam
User avatar
chiefmonkey
Forum Commoner
Posts: 25
Joined: Sat Apr 20, 2002 5:21 am
Location: Glasgow UK

Post by chiefmonkey »

Sam,

If you are talking about a production server then of course what you say makes sense, but when I think of windows/php combo I always think for testing purposes, infact I don't know of any Windows hosts who offer PHP, that may change as PHP matures and and the ISAPI module becomes more stable

George
User avatar
sam
Forum Contributor
Posts: 217
Joined: Thu Apr 18, 2002 11:11 pm
Location: Northern California
Contact:

Post by sam »

Sure I guess I was. With php 4.2.0 and the upcoming 4.3.0 and apache 2.0.x I think that windows hosting is going to become a php mainstay, they will beable to offer the best of the unix and windows worlds... I also like to keep every thing out of my windows directory because I frequently format it and reinstall windows (4 times already this week :) ).

That brings up another question, does anyone know if you can mask the php.ini file. IE add a file with a few lines pointing to another location. I hate haveing to create a new one every time I format my c: drive and I keep forgetting to save a backup.

Cheers Sam
Post Reply