Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » open_basedir restriction

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

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

Page: 1 2
Go to End
Author Topic: 5227 Views
  • trevor
    Avatar
    53 Posts

    open_basedir restriction Link to this post

    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

  • sazlheld
    Avatar
    Community Member
    2 Posts

    Re: open_basedir restriction Link to this post

    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?

  • trevor
    Avatar
    53 Posts

    Re: open_basedir restriction Link to this post

    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

  • Salzheld
    Avatar
    Community Member
    8 Posts

    Re: open_basedir restriction Link to this post

    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.

  • trevor
    Avatar
    53 Posts

    Re: open_basedir restriction Link to this post

    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

  • Salzheld
    Avatar
    Community Member
    8 Posts

    Re: open_basedir restriction Link to this post

    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.

  • trevor
    Avatar
    53 Posts

    Re: open_basedir restriction Link to this post

    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.

  • Salzheld
    Avatar
    Community Member
    8 Posts

    Re: open_basedir restriction Link to this post

    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

    5227 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.