Session problem

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
saeen
Forum Newbie
Posts: 24
Joined: Mon Sep 22, 2003 5:35 am
Contact:

Session problem

Post by saeen »

hi thr
im workin on this website built in php...im assigned to modify the already developed website and im jus havin this tiny prb that at the top of the page thrs a statement session_start but ummm its givin me an error
ERROR" Warning: open(/tmp\sess_241a34b94a7376578362564913ec131c, O_RDWR) failed: m (2) in C:\apache\htdocs\kfp\admin\index.php on line 2"

which means like the session is not created and when i access other pages they wont grant me access as the session doesnt have the required value...does any1 know how can i solve this prb
thanx
toms100
Forum Contributor
Posts: 119
Joined: Wed Feb 26, 2003 10:29 am
Location: Bristol,UK

Post by toms100 »

you really need to give more info, like some of the code!
aer you using session_start(); ?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

http://www.php.net/manual/en/ref.session.php wrote:session.save_path string
session.save_path defines the argument which is passed to the save handler. If you choose the default files handler, this is the path where the files are created. Defaults to /tmp.
...
Note: Windows users have to change this variable in order to use PHP's session functions. Make sure to specify a valid path, e.g.: c:/temp.
you have to change that setting in your php.ini, /tmp is (usually) not a valid win32-path
saeen
Forum Newbie
Posts: 24
Joined: Mon Sep 22, 2003 5:35 am
Contact:

Post by saeen »

hey volka that did the job thanx alot...but one thing like i have specified a path like C:/temp and created a temp folder in the c drive but i wanted that if i cud just specify /temp and php wud look for a temp folder inside the current working directory..is that possible coz u know defining the physical drive in a proffessional project wont b a good idea...one thing i must tell u that this project has been assigned to me at office and im like totally new to PHP.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

hm, I don't see how this will affect the professionalism of a php-project - installing/configuring the webserver enviroment is a completely different task - but anyway.
Yes, it is possible to specify the savepath relative to the requested document. (I only have a w2k and a gentoo box for testing at hand right now, both having php installed as module for apache)

e.g. session.save_path = . will store the sessiondata files in the same directory as the requested document, ./session.tmp in a directory session.tmp that resides in the same directory as the requested document ...and so on.
But as long as there's no (very) special need for that feature I'd strongly advise against it...

edit: hope it's half-decent english now. I'd better keep my fingers off the keyboard while typing today ;-)
Last edited by volka on Mon Sep 29, 2003 3:01 am, edited 2 times in total.
saeen
Forum Newbie
Posts: 24
Joined: Mon Sep 22, 2003 5:35 am
Contact:

Post by saeen »

hey i jus said that profressional thing coz i meant like when u give away the project ull have to manually change the path on the server and make a directory in the c drive??? thats wat i think atleast i apologize if im wrong...well since u don recommend using the method u told me abt then i think i shud seriiously consider ur advise since ur the one with more knowlege :) thanx
Post Reply