Change default open_basedir?

patrik

Verified User
Joined
Sep 6, 2006
Messages
126
In the default open_basedir we have /tmp/ but this doesn't seem to work on FreeBSD as our customers getting this error:
Warning: session_save_path() [function.session-save-path]: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/web00001/:/tmp/:/var/www/:/usr/local/lib/php/:/etc/virtual/:/var/uploads/:/var/squirrelmail) in /usr/home/web00001/domains/example.org/public_html/includes/functions/sessions.php on line 148
To fix this I have to edit the users httpd.conf and add /tmp without trailing slash but as soon as we rewrite httpd configuration the old default open_basedir overwrites my changes. How can I change the open_basedir in the default configuration?
 
Can you tell us what is on this line:

/usr/home/web00001/domains/example.org/public_html/includes/functions/sessions.php on line 148

Copy us this line and we might be able to fix it :D
 
I don't like to fix it from this end, I would rather change the default open_basedir than changing code for every customer having this problem.

But the line says: return session_save_path($path);
Where $path = SESSION_WRITE_DIRECTORY when invoked (I think), this is a osCommerce application and I don't like to dig into the code.
 
I remember solving this same problem for a friend of mine, i changed a configuration within the MySQL DB using phpMyAdmin.

This is what you need to do:

Fix: Goto Admin / Configuration / Sessions and change the "Sessions Directory" to tmp (no slashes)

If you can't get into Admin, goto your Database Admin page (usually PhPAdmin app.)
Click on any table on the left hand side.
Click on SQL at the top of the screen
Overtype whatever appears in the SQL window with ...


UPDATE configuration SET configuration_value = 'tmp' WHERE configuration_key='SESSION_WRITE_DIRECTORY'

It is also described here

Greetings
 
P.S

This is a bug in OSCommerce .. dont change any httpd.conf or any other open_basedir config as this is not needed !! read the post above for the solution.

Regards

Michel
 
Back
Top