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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

open_basedir restriction


Go to End


11 Posts   6042 Views

Avatar
trevor

53 Posts

17 October 2007 at 8:06am

Edited: 17/10/2007 8:07am

Hi,

I'm loading my silverstripe site onto a host (I've changed from one already as too many issues setting up) however I came across an open_basedir restriction in ManifestBuilder.php line 50.

So on investigating I think the issue is due to the scandir returning . and .. directories with the .. directory not being allowed in the open_basedir restriction.

So I added the following in the foreach loop also required at line 64 and 84 but with the variable $filename instead of $file and my warning has gone.

if(substr($file,0,1) == '.') continue;

Maybe a core developer could review this and add if appropriate.

HTH

regards

trevor

Avatar
sazlheld

Community Member, 2 Posts

7 January 2008 at 7:51am

I have the same open_basedir problems. I am able to use silverstripe if I upload silverstripe in it's own directory in my root (silverstripe/assets etc.).
Your fix doesn't work for me. Silverstripe is just not working correctly with it (although I get no more open_basedir errors).

I get another Problem with my fix:
Instead of: http://testblog.diekretzschmars.de
I have to write: http://testblog.diekretzschmars.de/sivlerstripe/

Can someone post a working .htaccess for me?

Avatar
trevor

53 Posts

8 January 2008 at 12:33am

HI,

What version of SS are you using?

What exactly do you mean by "Silverstripe is just not working correctly with it" all this does is skip . and .. directories?

If you want to leave in a seperate directory then I think all you need to do is add the directory onto the rewrite rule to main.php although I've never done this myself.

HTH

Avatar
Salzheld

Community Member, 8 Posts

8 January 2008 at 4:47am

THe problem is that I can't tell you exactly what was wrong because I already installed it in a subdir now. I just wasn't working. What are those directories for when they aren't needed. By the way the problem was in ManifestBuilder.php. What is this file about? What exactly is a manifest file and what is it used for? Is there no use of those . and .. dirs?

I made a copy of the .htaccess file, added the silverstripe dir and copied it to the base dir:

### SILVERSTRIPE START ###
RewriteEngine On

RewriteCond %{REQUEST_URI} !(\.gif)|(\.jpg)|(\.png)|(\.css)|(\.js)|(\.php)$

RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* silverstripe/sapphire/main.php?url=%1&%{QUERY_STRING} [L]
### SILVERSTRIPE END ###

Seems like it is working now.

I will do a fresh install soon and tell what problems your fix causes here.

Avatar
trevor

53 Posts

8 January 2008 at 5:04am

The . and .. files are the current and parent directories that are also returned by the scandir function and if you have open_base restriction in effect, these file enable you to do cd .. to go up a directory and can be used in relative directory addressing.

If you have it working then you don't need to reinstall I was just trying to help.

Regards

Trevor

Avatar
Salzheld

Community Member, 8 Posts

8 January 2008 at 5:20am

Sorry my english is really bad.
I know what those dirs are for. But why aren't they needed for manfest builder?
By the way I am already installing.

Avatar
trevor

53 Posts

8 January 2008 at 6:02am

Hi,

Your english is better than my German :)

they are not required, i think, because the routine is looking for code within the directories to establish which modules are installed and global variables defined. This is used as a look up so that it is quicker than traversing the directory structure each time.

Avatar
Salzheld

Community Member, 8 Posts

8 January 2008 at 7:27am

I now installed silverstripe again. It seems like you where right.

But now I have the same problem as on my local installation. I just can't get the navigation to show up. You can surf to about-us and all those standard pages but they don't appear in the header.

http://testblog.diekretzschmars.de
http://testblog.diekretzschmars.de/about-us

Go to Top