Jump to:

4952 Posts in 14338 Topics by 1491 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Problems Uploading Files & Images After Install

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: 2618 Views
  • anthonyharrison
    Avatar
    Community Member
    2 Posts

    Problems Uploading Files & Images After Install Link to this post

    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.

  • JackAttack
    Avatar
    Community Member
    12 Posts

    Re: Problems Uploading Files & Images After Install Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Problems Uploading Files & Images After Install Link to this post

    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");

  • anthonyharrison
    Avatar
    Community Member
    2 Posts

    Re: Problems Uploading Files & Images After Install Link to this post

    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

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