Page 1 of 1

PostPosted: Fri Oct 06, 2006 9:28 am
by graeme1950
I've been working with dataface locally on my laptop. I've just uploaded to my dedicated webserver and get the following error;

Warning: mkdir(): open_basedir restriction in effect. File(/var/lib/php/session/dataface) is not within the allowed path(s): (/tmp:/home/default/[websitehere]) in /home/default/[websitehere]/user/htdocs/dataface/Dataface/Application.php on line 520

As I have complete control I've tried creating tmp in various locations and set it to 0777 still no luck ~ even the root /tmp file set to 0777 no luck I'm running with Fedora core 5.0

Any advice appreciated please
Thanks
Graeme Hird

PostPosted: Fri Oct 06, 2006 9:49 am
by shannah
OK.. here is the problem. Dataface tries to create a subdirectory of your current session directory to store its session data. This is so that you can specify the session lifetime of your dataface sessions independent of other php scripts you have running.

Your server is set to store sessions in the /var/lib/php/session/ directory, which is outside your allowed domain to create files. You can create files in the
/tmp
and
/home/default/[websitehere]
directory trees.

Solution:

At the beginning of your application's index.php (or whatever it is called), add the following:

Code: Select all
ini_set('session.save_path', '/tmp');


This will set the session data to be stored in /tmp. Alternatively you can choose a path somewhere in your /home/default/[websitehere] directory tree for more security.

Hope this helps.

Best regards

Steve

PostPosted: Sat Oct 07, 2006 2:10 am
by graeme1950
Thanks Steve
I'll give it a try, I know it'll work
Best Regards
Graeme

PostPosted: Sat Oct 07, 2006 12:58 pm
by graeme1950
O.K. First bit worked, now getting past the tmp directory stage and now get this..

Notice: Undefined index: -relationship in /home/default/[website]/user/htdocs/dataface/Dataface/Application.php(981) : eval()'d code on line 1

Notice: Undefined index: -relationship in /home/default/[website]/user/htdocs/dataface/Dataface/Application.php(981) : eval()'d code on line 1

Notice: Use of undefined constant history__id - assumed 'history__id' in /home/default/[website]/user/htdocs/dataface/Dataface/Application.php(981) : eval()'d code on line 1

Notice: Undefined variable: context in /home/default/[website]/user/htdocs/dataface/Dataface/Application.php(981) : eval()'d code on line 1

I get everything working as expected - yet each page has this notice displayed.

Everything has been runing on my laptop under Windows XP Home, and normally I can find and understand why something is broken.

Thanks in anticipation
Graeme

PostPosted: Sat Oct 07, 2006 1:44 pm
by shannah
Thanks for pointing this out... try going to line 981 of Application.php . You'll see something like:
Code: Select all
return eval('return '.$matches[1].$matches[2].';');


change it to:
Code: Select all
return @eval('return '.$matches[1].$matches[2].';');


Note the only change was to prepend '@' to the beginning of the eval() call.

Let me know how that works.

-Steve

PostPosted: Sat Oct 07, 2006 4:21 pm
by graeme1950
Thanks for pointing this out... try going to line 981 of Application.php . You'll see something like:

>


return eval('return '.$matches[1].$matches[2].';');

>


>

change it to:

>


return @eval('return '.$matches[1].$matches[2].';');

>


>

Note the only change was to prepend '@' to the beginning of the eval() call.

>

Let me know how that works.

>

-Steve



Excellent ~ thats suppressed the error messages and now working perfectly.

Best Regards
Graeme