Jump to content

session_start() barks out "open_basedir restriction in effect"


paulferree

Recommended Posts

I've googled this until my brain turned to mush.

 

This is the error im getting when I call the session_start() function.

 

Warning: session_start() [function.session-start]: open_basedir restriction in effect. File(C:\Windows\TEMP\) is not within the allowed path(s):

 

I'm on IIS7......

 

Thanks for the help!!! Im braindead now.

 

Paul

change the session directory

with

session_save_path

 

but remember to put that above every script that will use sessions, or you could set teh save path directly in the php.ini which is session.save_path you set that to somewhere where you DO have access to..

 

u could do that until someone here like daniel comes and gives you a better way, or solution without having to change the path, but I'm more than sure eventually you'll be editing some sort of configuration file

Either something else is wrong or Im not doing this right...

 

above my session start I pointed to a specific folder I created on the site

save_session_path('/session_save/');

 

and it gave me the same error.

 

also, when I run php_info for the value open_basedir it shows the server path to this website.  I've seen other servers that just show this as  "no value".  In the php.ini file the open_basedir line is commented out.

 

Thanks!

Paul

Well...that worked! It made me realize that for some reason I had problems with a relative path.  So when I put in the absolute server path it worked fine.

 

Thank you so much Russell for this fix.  Still frustrating as to why it's not working "out of the box".

 

Paul

  • 3 weeks later...

This issue has reared its head again.

 

What in the php.ini / overall configuration do I need to check in order to make this function correctly?

 

open_basedir is commented out in the php.ini file and safe mode is not enabled.

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.