paulferree Posted June 18, 2009 Share Posted June 18, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/ Share on other sites More sharing options...
RussellReal Posted June 19, 2009 Share Posted June 19, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-859294 Share on other sites More sharing options...
paulferree Posted June 19, 2009 Author Share Posted June 19, 2009 Thanks! I'll give this a shot and see what happens... FYI I also get this same error when using file functions. Is that indicative of anything in particular? Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-859581 Share on other sites More sharing options...
paulferree Posted June 19, 2009 Author Share Posted June 19, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-859608 Share on other sites More sharing options...
RussellReal Posted June 19, 2009 Share Posted June 19, 2009 save_session_path('session_save'); try that, and, maybe.. try this: ini_set('open_basedir','/'); or set your php.ini value for open_basedir (if you have access to it) to '/' or '/www/' Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-859616 Share on other sites More sharing options...
paulferree Posted June 19, 2009 Author Share Posted June 19, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-859634 Share on other sites More sharing options...
RussellReal Posted June 19, 2009 Share Posted June 19, 2009 not sure.. maybe when you installed whatever program installed php, it so you could do the least amount of damage to your own server lol Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-859636 Share on other sites More sharing options...
paulferree Posted July 10, 2009 Author Share Posted July 10, 2009 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! Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-872848 Share on other sites More sharing options...
paulferree Posted July 10, 2009 Author Share Posted July 10, 2009 Looks like I found the problem, session.save_path wasn't set. Set it, now all seems to be well. Quote Link to comment https://forums.phpfreaks.com/topic/162833-session_start-barks-out-open_basedir-restriction-in-effect/#findComment-872912 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.