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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

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

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

TEMP_FOLDER Definition


Go to End


9 Posts   7442 Views

Avatar
gakenny

Community Member, 153 Posts

22 June 2007 at 10:01am

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

Avatar
Bitmand

Community Member, 5 Posts

22 June 2007 at 11:24am

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 :)

Avatar
gakenny

Community Member, 153 Posts

22 June 2007 at 12:38pm

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?

Avatar
Sigurd

Forum Moderator, 628 Posts

22 June 2007 at 2:26pm

Cheers bitmand for helping out with that :)

Avatar
Bitmand

Community Member, 5 Posts

22 June 2007 at 10:44pm

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.

Avatar
gakenny

Community Member, 153 Posts

23 June 2007 at 6:09pm

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

Avatar
zaud

5 Posts

26 August 2007 at 6:01am

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

Avatar
damsel

Community Member, 8 Posts

18 November 2007 at 4:53am

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 :)

Go to Top