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.

Archive /

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

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

Problems with shared hosting environment....


Reply


5 Posts   2425 Views

Avatar
JohnnyO

5 Posts

28 July 2007 at 5:36pm

Edited: 28/07/2007 5:37pm

Hey,

Have had a look around the forums and have managed to sort out a couple of the problems I've run in to with Silverstripe with the latest download (silverstripe-v2.0.2b)

Have been running/ playing about on my laptop but things are not going smoothly when installed in a shared hosting environment - with safe mode and open_basedir restrictions.

I've managed to get silverstripe installed following tips found at http://www.silverstripe.com/general-discussion/flat/1699 - but there are a lot of error messages:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../_ss_environment.php) is not within the allowed path(s): (/tmp:/www/virtual/someSite.co.nz/htdocs:/www/virtual/tmp:/usr/local/php5/lib/php) in /www/virtual/someSite.co.nz/htdocs/sapphire/main.php on line 40

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../../../_ss_environment.php) is not within the allowed path(s): (/tmp:/www/virtual/someSite.co.nz/htdocs:/www/virtual/tmp:/usr/local/php5/lib/php) in /www/virtual/someSite.co.nz/htdocs/sapphire/main.php on line 40

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/www/virtual/someSite.co.nz/htdocs/../) is not within the allowed path(s): (/tmp:/www/virtual/someSite.co.nz/htdocs:/www/virtual/tmp:/usr/local/php5/lib/php) in /www/virtual/someSite.co.nz/htdocs/sapphire/core/ManifestBuilder.php on line 50

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/www/virtual/someSite.co.nz/htdocs/../) is not within the allowed path(s): (/tmp:/www/virtual/someSite.co.nz/htdocs:/www/virtual/tmp:/usr/local/php5/lib/php) in /www/virtual/someSite.co.nz/htdocs/sapphire/core/ManifestBuilder.php on line 64

Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/www/virtual/someSite.co.nz/htdocs/..) is not within the allowed path(s): (/tmp:/www/virtual/someSite.co.nz/htdocs:/www/virtual/tmp:/usr/local/php5/lib/php) in /www/virtual/someSite.co.nz/htdocs/sapphire/core/ManifestBuilder.php on line 82

I'm no genius and have no idea what/ where _ss_environment.php comes from.

I can get everything looking neat and tidy - hiding these warnings via .htaccess file but things are broken.

When managing Files & Images, I can successfully create a new dir (images) and it looks as though I can create a new sub dir too (images/brands) but as soon as I refresh the admin site, there is no dir - and logging in via FTP, you can't see the dir.

I'm wanting to persist with Silverstripe and figured I could just ftp all these files - which worked fine until I try and use the images. The links within the pages reference a different location eg. assets/images/brands/_resampled/ResizedImage25079-bechstein.gif which doesn't exist.

Anyone able to offer any suggestions/ help!

Thanks.

Avatar
Sam

Administrator, 685 Posts

30 July 2007 at 5:56am

This is a bit of a hack, but it should give you a fix:
Remove lines 38-44 of main.php - the stuff about envFiles.

We'll need to change this code to only execute if you don't have safe mode / open_basedir set.

Avatar
JohnnyO

5 Posts

30 July 2007 at 8:50am

Hey thanks Sam.

Removing those lines sorted out the problem with the warnings, but the bigger problem still remains - I'm unable to create subfolders/ upload any assests via the Files & Images section of the admin site.

I don't get any error/ messages to help troubleshoot the problem.

When I try and upload an image the following is displayed:
ERROR:
Error

The website server has not been able to respond to your request.

Thanks in advance!

John

Avatar
Sean

Forum Moderator, 922 Posts

30 July 2007 at 9:22am

Edited: 30/07/2007 9:23am

Place this line in your _config.php inside mysite:

Director::set_environment_type('dev');

This should then give you some actual error information so you can either attempt to resolve, or ask again here on the forums. :-)

Hope this helps!

Sean

Avatar
JohnnyO

5 Posts

30 July 2007 at 9:43am

THat's better - a lot more detail now!

As with all the other problems - related to safe mode restrictions:
FATAL ERROR: copy() [function.copy]: SAFE MODE Restriction in effect. The script whose uid is 4596 is

not allowed to access /www/virtual/someSite/htdocs/assets/images owned by uid 33
At line 209 in /www/virtual/someSite/htdocs/sapphire/filesystem/Folder.php

copy(/www/virtual/tmp/phpgmMGcw,/www/virtual/someSite/htdocs/assets/images/1.jpg)
line 209 of Folder.php

Folder->addUploadToFolder(Array)
line 156 of AssetAdmin.php

AssetAdmin->doUpload(Array,Form)
line 108 of Controller.php

Controller->run(Array)
line 48 of Director.php

Director::direct(admin/assets/index/1)
line 100 of main.php
Context

Is there anything constructive I can pass on to the hosting company which will provide a solution? They do seem very reasonable people :)