Page 1 of 1
Session problem
Posted: Mon Sep 29, 2003 1:54 am
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
Posted: Mon Sep 29, 2003 2:02 am
by toms100
you really need to give more info, like some of the code!
aer you using session_start(); ?
Posted: Mon Sep 29, 2003 2:03 am
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
Posted: Mon Sep 29, 2003 2:18 am
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.
Posted: Mon Sep 29, 2003 2:36 am
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

Posted: Mon Sep 29, 2003 2:42 am
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