Page 1 of 1

using the SESSION superglobal

Posted: Tue Mar 16, 2004 6:25 am
by joki
Hi

I am having a problem with the SESSION superglobal. When I use the session_start(); command within a php page I have an error of "Warning: session_start(): open(/tmp\sess_91fe588e6cb297919441b949431254f1, O_RDWR) failed: No such file or directory (2) in c:\web\listing10.2.php on line 2 So I changed the setting of session.auto_start = 1 in the php.ini, which fixes this problem but I then have a problem which is Warning: Unknown(): open(/tmp\sess_562f3ba648ebc190d50011c8b45e9209, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Can anyone help??
Thanks
Joki

Posted: Tue Mar 16, 2004 6:59 am
by redmonkey
Look for the session.save_path definition in your php.ini file and set that to the full path of a directory you want to use for storing session data.

The session.save_path will most likely be set to /tmp at the moment so setting it to something like....

session.save_path = "C:\windows\temp"

Should fix your problem.

Posted: Wed Mar 17, 2004 3:17 am
by joki
thanks redmonkey, works fine now :)

Posted: Wed Mar 17, 2004 5:43 am
by redmonkey
Your welcome.

Sessions directory does not exist

Posted: Thu Mar 18, 2004 10:50 am
by mtnwinds
I've been unable to resolve this message. I've tried changing "session.save_path" as suggested above but the error persists: Warning: session_start(): open(/tmp\sess_abe4e322cfe4629a5791866fdb65b662, O_RDWR) failed: No such file or directory (2) in e:\easyphp1-7\www\catalog\includes\functions\sessions.php on line 67

Would really appreciate any help :x

Posted: Thu Mar 18, 2004 10:53 am
by markl999
Your session.save_path is still wrong. Make sure you're editing c:\windows\php.ini , change session.save_path to something like c:\temp (or some other temp directory that exists) then restart apache.
Also check a phpinfo() page ( just <?php phpinfo() ?> in a file ), that will show you the value of session.save_path

Posted: Fri Mar 19, 2004 12:05 am
by mtnwinds
php.ini is no longer stored in c:\windows. Mine is in ..\apache\. phpinfo() returns the correct path, which exists on my hard drive.

Posted: Fri Mar 19, 2004 12:09 am
by markl999
Not sure what's going on then. If you put the following line at the top of the script that produces the error, what does it output?

echo ini_get('session.save_path');

Posted: Fri Mar 19, 2004 12:10 am
by mtnwinds
Also, if I set sessions.auto_start to 1, the error msg. changes somewhat. It drops the ref. to the specific call that fails and simply says the path doesn't exist. However, when I check the /tmp dir I find a session file exist there.

Posted: Fri Mar 19, 2004 12:13 am
by mtnwinds
This is what it returns...which is the correct path: E:\EasyPHP1-7\tmp

Posted: Fri Mar 19, 2004 12:20 am
by markl999
Well, if it's not using the save_path that's in your php.ini then i can only think it's coming from a .htaccess or in a vhost section of your httpd.conf ... if it's neither of those 2, then i'm all out of ideas :o

Posted: Fri Mar 19, 2004 12:36 am
by mtnwinds
I found it Mark. I'm running the oscommerce catalog file (http://www.oscommerce.com) When you asked me to insert 'echo ini_get('session.save_path') I found the 'index.html' file & stuck it in there. When that didn't work I got to thinking that there must be another file and there was...configure.php located in ..\catalog\includes. At the very bottom there is: define('STORE_SESSIONS', ' '. The recommendation is to set it to MySQL but I set it to 'e:/easyphp1-7/tmp'); and that did the trick. Appreciate your help very much & hope this post will help someone else out.