Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Error: open_basedir restriction in effect. after install version 2.4


Go to End
Reply


11 Posts   4693 Views

Avatar
Zalz

Community Member, 3 Posts

6 May 2010 at 7:08am

Hello Everyone,

I just installed version 2.4 but getting this error when I want to login in backend.

[Warning] is_dir() [function.is-dir]: open_basedir restriction in effect. File(/tmp/) is not within the allowed path(s): (/mnt/webspace/04/28399/abada-capoeira.de:/mnt/webspace/04/28399/php_includes:/mnt/webspace/04/28399/php_sessions:/mnt/webspace/04/28399/temp)

GET /www/admin/?flush=1

Line 152 in /mnt/webspace/04/28399/abada-capoeira.de/www/sapphire/thirdparty/Zend/Cache/Backend/File.php

Does anybody no how to solve this problem Thanks!

Zalz

Attached Files
Avatar
nakashu

Community Member, 24 Posts

12 May 2010 at 2:18am

Edited: 12/05/2010 3:22am

Same problem here.
Anyone got leads / hint to possible problem / solution?

Also tried creating folder "silverstripe-cache" and setting permission on 777, still the problem is on, with the path to /var/tmp and/or /tmp

thanks for replies

Avatar
BigChris

Community Member, 63 Posts

12 May 2010 at 6:17am

The problem is the file cache for SilverStripe is being set for the default temp file area and the setting of open_basedir in the php.ini file. Its usually set on shared hosting, but you may have control over it.

In this case it looks like the default temp cache area is being denied access via the open_basedir setting.

The solution as you have correctly worked out is to set up the silverstripe-cache directory.
I followed these steps http://www.electrictoolbox.com/silverstripe-cache-directory/

I think the step you have probably missed is to create the _ss_environment.php file.

Also ensure both the assets and silverstripe-cache directory are set to 777.

That should help.
Chris

Avatar
nakashu

Community Member, 24 Posts

12 May 2010 at 10:00am

Thank you BigChris
tried those things but didnt resolved the problem

the thing is cache data wrote to desired directory to which I set it to write BUT
the cms is still afterwards blocked by open_basedir restrictions, as the path to the new temp dir needs to be set full, like:
/the/whole/path/to/temp/

but the restriction on the server blocks going to / . . So i would need a way how to set the path relatively and it would work.

is there a way how to set it as relative path? with write access?

Any help greatly appreciated

Avatar
BigChris

Community Member, 63 Posts

12 May 2010 at 10:38am

oh dear.

I would then try and have the following in the _ss_environment.php

$cache = $_SERVER['DOCUMENT_ROOT'] .'/silverstripe-cache/';
define('TEMP_FOLDER', $cache);

Chris

Avatar
BigChris

Community Member, 63 Posts

12 May 2010 at 10:40am

Also if that does not work, you might have to ask the Hosting company to add your path to the Cache folder to the php.ini file.

Avatar
nakashu

Community Member, 24 Posts

12 May 2010 at 10:48pm

Edited: 12/05/2010 10:58pm

Thank again BigChris

the problem was resolved but with non of those things.

as i was testing things out, i realized that everytime i change the cache directory, the data is writen there but the error still states the location of temp directory as /tmp..

searched the code and in sapphire/thirdparty/Zend/Cache/Backend.php is this part of code / line 164

} else {
// unix...
if (isset($_ENV['TMPDIR'])) return $_ENV['TMPDIR'];
if (isset($_SERVER['TMPDIR'])) return $_SERVER['TMPDIR'];
return '/tmp';
}

what i did is that i hardcoded the location of my temp file, replaced the /tmp with my own location.
the thing is it seems as it would skip, the settings in _ss_enviroment.php, and allways fall down to the return '/tmp';

Is this for a bug? Or a mistake on my part?

OK Found ticket that is relevant to this issue. .. it is for 2.4.0 rc1 -- #5493 http://open.silverstripe.org/ticket/5493

Avatar
rakiapu

Community Member, 2 Posts

16 June 2010 at 12:18am

Edited: 16/06/2010 12:19am

man the word 'hardcode' what is this...And how to do is...Im havin the same problem...It runs in local host in my pc but not on webserver...please clear it up what u did..and please make it easy to understand...I can google but cant write any php...so please some more help

Go to Top