Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » TEMP_FOLDER Definition

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: 5455 Views
  • gakenny
    Avatar
    Community Member
    153 Posts

    TEMP_FOLDER Definition Link to this post

    Hello,

    As per a previous post by another user, I having a problem installing SilverStripe on a shared server with SAFE_MODE enabled.

    This generates the following messages:
    ---
    Warning: fopen() [function.fopen]: SAFE MODE Restriction in effect. The script whose uid is 32599 is not allowed to access /tmp owned by uid 0 in .../public_html/silverstripe/sapphire/core/ManifestBuilder.php on line 105
    ---
    Warning: fopen(/tmp/manifest_home_..._public_html_silverstripe_sapphire_main.php) [function.fopen]: failed to open stream: Permission denied in .../public_html/silverstripe/sapphire/core/ManifestBuilder.php on line 105
    Cannot write manifest file! Check permissions of /tmp/manifest_home_..._public_html_silverstripe_sapphire_main.php
    ---

    I have seen in Manifest.php that there is a variable called TEMP_FOLDER used to specify the path for temporary files. Can this be changed? It appears that this is a different path to that used in the initial step of install.php.

    Cheers,

    Gary

  • Bitmand
    Avatar
    Community Member
    5 Posts

    Re: TEMP_FOLDER Definition Link to this post

    Hey Gary,

    I am actually running a web host company and had the same problem installing SS in our safe mode enabled web hotel.

    I actually changed a couple of things to make it work:

    1) Create a /tmp directory in your FTP root and chmod 777 /tmp

    2) Change line 108 in: /web/install.php to something like:
    if(!is_writeable("/full/path/to/your/root/tmp"))

    (/web is root of the website and where my SS files is)

    3) Change line 3 in: web/sapphire/core/Core.php to something like:
    define('TEMP_FOLDER', "/full/path/to/your/root/tmp");

    4) Change line 50 in: /web/sapphire/core/ManifestBuilder.php to
    if( is_dir($fullPath."/") && file_exists($fullPath . '/_exclude.php') )

    Please note the step 4 isn't really a safe_mode issue, it's a open_basedir issue, but if your web host has safe_mode enabled, chances are that they also have open_basedir set

    Hope it helps

  • gakenny
    Avatar
    Community Member
    153 Posts

    Re: TEMP_FOLDER Definition Link to this post

    It helps a treat! Thanks Bitmand

    Maybe there should be an option for specifying an alternative path for the temp directory in the setup of SilverStripe.

    Do you think the developers have picked up on this one?

  • Sigurd
    Avatar
    Forum Moderator
    628 Posts

    Re: TEMP_FOLDER Definition Link to this post

    Cheers bitmand for helping out with that

  • Bitmand
    Avatar
    Community Member
    5 Posts

    Re: TEMP_FOLDER Definition Link to this post

    hehe.. thanks

    I actually stumbled upon yet another small change:

    Change line 72 in: /web/sapphire/core/ManifestBuilder.php to:
       if(is_dir("$baseDir/$filename/") && file_exists("$baseDir/$filename/_config.php")) {

    This one is also a open_basedir fix and has nothing to do with safe_mode.

  • gakenny
    Avatar
    Community Member
    153 Posts

    Re: TEMP_FOLDER Definition Link to this post

    Hello,

    The issue was related to safe mode at my webhost. They have made a change and I can now install and run SilverStripe 'out-of-the-box'. I had some other issues with writing to the tmp folder in another location running the latest build after making the change above.

    Thanks for the assistance though. As the community grows, we can assist each other more and more.

    Kind regards,

    Gary

  • zaud
    Avatar
    5 Posts

    Re: TEMP_FOLDER Definition Link to this post

    Is there a setting in the php.ini file that needs changing to make this work?

    I've specified an alternate PHP.ini file and set the upload_dir to a /home/.../tmp folder but I still receive:

    Warning: fopen(/tmp/silverstripe-cache/manifest_home_..._public_html_sapphire_main.php) [function.fopen]: failed to open stream: Permission denied in /home/.../public_html/sapphire/core/ManifestBuilder.php on line 116
    Cannot write manifest file! Check permissions of /tmp/silverstripe-cache/manifest_home_...._public_html_sapphire_main.php

  • damsel
    Avatar
    Community Member
    8 Posts

    Re: TEMP_FOLDER Definition Link to this post

    I guess I'm retarded. I really don't understand the issue.....is the problem that safe mode is or is not enabled? Is the problem that open_basedir is or is not set?

    On my server, safe mode is not enabled and open_basedir is set to "no value" (not set, I'm assuming) and I'm getting the same error:

    I am now running through the installation steps (this should take about 30 seconds)

    If you receive a fatal error, refresh this page to continue the installation
    # Creating 'mysite/_config.php'...
    # Creating '.htaccess' file...
    # Building database schema...

    Warning: fopen(/tmp/silverstripe-cache/manifest_home_vvillage_public_html_sapphire_main.php) [function.fopen]: failed to open stream: Permission denied in /home/vvillage/public_html/sapphire/core/ManifestBuilder.php on line 133
    Cannot write manifest file! Check permissions of /tmp/silverstripe-cache/manifest_home_vvillage_public_html_sapphire_main.php

    What do I need to do in order to resolve this? Is this a problem with a setting for safe mode or open_basedir.......it is a setting in php.ini that needs to be fixed, do I need to create a directory and privs, or do I actually need to edit the installer files to fix this (if so, WHY?) The clueless community thanks you in advance

    5455 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.