Jump to:

4873 Posts in 7171 Topics by 1471 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » SS3.1 beta3 - SAFE MODE Restriction in effect

Getting SilverStripe up and running on your computer and on your web server.

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

Page: 1
Go to End
Author Topic: 1520 Views
  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    Hi,

    I need help installing SilverStripe 3 on my host. I have a lot of Silverstripe 2 installations running on the servers at that host, and i would like to continue using them.

    The host has safe_mode = on and it has not been a problem before.

    When i try to install 3.1 beta3 i get the following error (short version actually is 4 similar errors):

    Warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 593 is not allowed to access /var/www owned by uid 505 in /var/www/example.com/public_html/framework/core/Core.php on line 64

    I then just go and outcomment framework/core/Core.php line 54 - 64 (they handle Include _ss_environment.php files) after that i get directed to install.php.

    Install.php has the following error:

    Warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 593 is not allowed to access /var/www owned by uid 505 in /var/www/example.com/public_html/framework/dev/install/install.php5 on line 51

    It's again the function for including environment files - i leave it there and silverstripe installs.

    Visiting the site now gives the error:

    [Warning] is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/local/lib/php/Zend/Translate/Adapter/I18nRailsYamlAdapter.php) is not within the allowed path(s): (/var/www/example.com/:/var/www/tmp/)

    I'm stuck

    The funny part is that i actually tried the install 2 times, first time i somehow managed to get the system running. Then i decided to try again to be able to document the problems, and now i'm not able to get it running.

    I hope that someone will help me and others in the same situation - it's really frustrating not to be able to install my system og choice on my host.

    UPDATE: After another install where i just manually opened /install.php, i have the site running, except for a 4 warnings:

    Warning: realpath() [function.realpath]: SAFE MODE Restriction in effect. The script whose uid is 593 is not allowed to access /var/www owned by uid 505 in /var/www/example.com/public_html/framework/core/Core.php on line 64

    The problem seems just to be with including the "_ss_environment.php" file - a file i dont even think i'm using.
    However, if i outcomment the lines that do the search for _ss_environment.php, i get the error:

    [Warning] is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/local/lib/php/Zend/Translate/Adapter/I18nRailsYamlAdapter.php) is not within the allowed path(s): (/var/www/example.com/:/var/www/tmp/)

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    SOLVED!

    I surpressed the errors produced by realpath in framework/core/Core.php, by prfixing it with a @.
    I then tried to figure out what was going on with the error:

    [Warning] is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/local/lib/php/Zend/Translate/Adapter/I18nRailsYamlAdapter.php) is not within the allowed path(s): (/var/www/example.com/:/var/www/tmp/)

    My webhost was not able to see any errors produced, site looked ok. I tried from a different browser and no problem???
    After removing cookies on my main browser, no errors was produced here either.
    I guess something was left in the session - i have no idea what or how that can happen.

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    Setting Director::set_environment_type to dev (Director::set_environment_type("dev");) produces the error again:

    [Warning] is_readable() [function.is-readable]: open_basedir restriction in effect. File(/usr/local/lib/php/Zend/Translate/Adapter/I18nRailsYamlAdapter.php) is not within the allowed path(s): (/var/www/example.com/:/var/www/tmp/)

    I prefixed surpressed the warning from is_readable on line 198 of framework/thirdparty/Zend/Loader.php with a @ (if (@is_readable($file)) {) and it's working so far.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    How did this turn out for you?

    I have a client that is hosted on a server with safe_mode on and there is nothing I can do about moving or disabling.

    New project so I don't have access yet and want to see if it will work before planning too much.

  • Nobrainer Web
    Avatar
    Community Member
    134 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    Hi Liam,

    It is running on the server after the described changes and the performance also seems to be ok.
    My solution is hosted at unoeuro.com - and they do say they have special setup in place to try to avoid problems with safe_mode = on.

  • Liam
    Avatar
    Community Member
    470 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    Okay thanks.

    I guess I'll move ahead. The issue is that currently they're on a server with < php 5.3 within this company and the company will move the sites to a newer server they have with 5.3+ but cgi+safe_mode. I can't access it until the move so didn't want to do all of this only to find out it won't work, especially since they're charging us a move fee.

    And because of politics I can't change webhosts. My only other choice would be to use WordPress or something but I'd rather not.

    Fingers crossed but it seems like it should work.

  • gerrut
    Avatar
    Community Member
    3 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    The problem is probably relating to restrictions on the cace folder. This is easy to solve as follows:

    Create a directory in your root and name it like 'silverstripe-cache', the name does not really matter.

    CHMOD the directory to 777 (everyone should have write access)

    Now create a php file called _ss_environment.php in your root directory. This file should look something like:

    <?php
       define('TEMP_FOLDER', '[abspath]/silverstripe-cache');
    ?>

    With [abspath] being the absolute path to the root directory. For example /www/htdocs/mysite .

    Hope this helps.

  • PeterNL
    Avatar
    Community Member
    9 Posts

    Re: SS3.1 beta3 - SAFE MODE Restriction in effect Link to this post

    Thanks that worked out for me.

    Greetz Peter

    1520 Views
Page: 1
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.