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.

Installing SilverStripe /

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

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

Problems Uploading Files & Images After Install


Reply


4 Posts   2677 Views

Avatar
anthonyharrison

Community Member, 2 Posts

7 June 2009 at 6:53pm

Hi guys,

Using version 2.3.1 on an Australian host (Ilisys.com.au) and getting a nasty error when trying to upload an image file through 'Files & Images'. I can browse to the image/file ok but when I press the 'Upload Files Listed Below' I get an error.

I am on a shared hosting service and don't have access to php.ini. I've added a folder called 'silverstripe-cache' following reading other forum posts. I adjusted permissions on my assets directory to 777 to see if that helped.

Anyway the error I am receiving is:

[Warning] move_uploaded_file() [function.move-uploaded-file]: open_basedir restriction in effect. File(/tmp/php_upload/phpdx7OzZ) is not within the allowed path(s): (VIRTUAL_DOCUMENT_ROOT:/usr/local/lib/php:/usr/local/lib/ph:/home/chroot_lib/phplib/:/usr/local/bin/)
POST /admin/assets/UploadForm

Line 198 in /home/4-web/46/ad/<domain>.com.au/public/www/cms/code/AssetAdmin.php

Any suggestions or help is muchly appreciated.

Avatar
JackAttack

Community Member, 12 Posts

12 June 2009 at 5:56am

Hi Anthony,

I think I've just had the same problem and I'm on a host with similar restrictions (MelbourneIT = crap) ...As far as I can see I'm not able to upload files because SilverStripe can't find/access a temp folder somewhere..

It may be possible to set the folder manually in AssetAdmin.php (line 198) but I haven't done anything other than have a quick look (it's 2am and I need some sleep). I'll have a go at fixing it tomorrow... In the meantime if you find solution please share it!

Jack

Avatar
Hamish

Community Member, 712 Posts

12 June 2009 at 8:43am

Are you defining your temporary file location? For example, do you have an environment file (_ss_environment.php) that has a line like:

define('TEMP_FOLDER', dirname(getcwd())."/tmp");

Avatar
anthonyharrison

Community Member, 2 Posts

16 June 2009 at 1:00am

Awesome work Hamish.

Did exactly as you suggested and added a _ss_environment.php file to the root of my site with the define statement that you gave me. I also created a folder called 'tmp' at this level with the correct permissions!

Really appreciate your help - thanks again. JackAttack if you have this issue follow Hamish's instructions. For more info on _ss_environment.php check out this document http://doc.silverstripe.com/doku.php?id=environment-management

Cheers
Anthony