Error creating tmp file?

A place for users and developers of the Xataface to discuss and receive support.

Postby graeme1950 » Fri Oct 06, 2006 9:28 am

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
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Fri Oct 06, 2006 9:49 am

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby graeme1950 » Sat Oct 07, 2006 2:10 am

Thanks Steve
I'll give it a try, I know it'll work
Best Regards
Graeme
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby graeme1950 » Sat Oct 07, 2006 12:58 pm

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
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Sat Oct 07, 2006 1:44 pm

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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby graeme1950 » Sat Oct 07, 2006 4:21 pm

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
graeme1950
 
Posts: 14
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 27 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved