View Full Version : Where to create /tmp for sessions

12-03-2002, 04:53 AM
I just startet installation of Oscommerce (using oscdox docu) everything went fine. When i enter in to the shop i get the following error.....

Warning: open(/tmp/sess_3d5d57d172a02e0998eae11f7a824acb, O_RDWR) failed: m (2) in includes/functions/sessions.php on line 67

I found some informarmation here oon the board that the /tmp directory has to be created, but where?

any help would be appreciated
Thanks Peter Pichler

12-03-2002, 07:34 PM
I had the same problem. Michael sent this:
Put it above your catalog dir, so if your apache web tree looks like this:


Put the temp dir in c:\webroot . If that doesnt work, try putting it in C:\webroot\websites
Hope this helps,
neil :idea:

12-03-2002, 09:15 PM
Hi Neil

Thanks for your help, i have to say that the webspace is hostet externally.
i did create /tmp at

No way, still the same error message.

Again many thanks for your reply.

12-04-2002, 12:20 PM
Put the /tmp dir ABOVE your public_html dir or www dir.

See this example:


Right now, with your example you have:


That should fix it...

12-09-2002, 06:42 AM
Thank's will try it as soon as possible.

best regards Peter

12-10-2002, 03:57 AM

I think i got it, actually the /tmp/ directory is defined in the PHP.INI (session.save_path) i talked to our host and the y don't allow to access this directory.
Is there any possibility to specify in the scripts an other /tmp/ directory?

Many thanks Peter

12-10-2002, 09:58 AM
This is defined in application_top.php. Try changing the path defined in this line (roughly 166):

define('PHP_SESSION_SAVE_PATH', '/tmp');

I believe you can change it to whatever dir you like, just make sure the path is correct. You may have do disable the
if statement for it to work.

12-10-2002, 10:24 AM
Thanks, will check it out.....
best regards Peter

12-10-2002, 11:25 AM
Hi, i did the changes in application_top.php....
still the same error....
Warning: Failed to write session data. Please check that the current setting of session.save_path is correct (/tmp) in Unknown on line 0

I changed both application_top.php \admin\include\ as well as catalog\include with the following

if (!function_exists('session_start')) {
define('PHP_SESSION_NAME', 'sID');
define('PHP_SESSION_SAVE_PATH', '/www.hostname.com/subdir/os_commerce/tmp');

if i disable the if function i get a parse error??

As i am not really a PHP crack it is not so easy to understand why it is looking still for the /tmp and not for /www.hostname.com/subdir/os_commerce/tmp

Thanks and best regards Peter

12-15-2002, 04:33 PM
define('PHP_SESSION_SAVE_PATH', '/www.hostname.com/subdir/os_commerce/tmp');

This is incorrect. It should not be a URL but a path:

define('PHP_SESSION_SAVE_PATH', '/subdir/os_commerce/tmp');

12-15-2002, 08:23 PM
I did it allready as you mentioned, no success.

thanks and best regards Peter