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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Image upload problem - v2.2.3


Go to End
Reply


16 Posts   3283 Views

Avatar
cappelmans

Community Member, 6 Posts

20 January 2009 at 2:48am

Hi all,

I recently installed Silverstripe on my laptop to figure it out, it all worked perfectly so i decided to use it for a website.

Installation went great and everything seems to work allright. The only problem i am facing right now is the ability to upload images.

When i select an image in the "Files and Images" tab, and click to upload i receive the following error:

Error

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

In my attempt to solve this problem I chmodded the assets folder to 777, and also the folders below this directory (uploads etc).

I read alot of topics and solutions but i just cannot get it to work. Does anybody have a clue? I still think it has to do with user rights, considering it all worked fine on my laptop.

My Silverstripe version: 2.2.3 and it runs on a Linux server.

Thanks in advance,

Jan-Willem

Avatar
Fuzz10

Community Member, 787 Posts

20 January 2009 at 3:13am

Hi , and welcome to Silverstripe...

Hmmmm... odd.... Check your apache logs for errors...

I bumped into a problem with the assets some time ago .... Don't think it is the same problem , but you never know...

http://www.silverstripe.org/customising-the-cms/show/250920

Avatar
cappelmans

Community Member, 6 Posts

20 January 2009 at 3:38am

Hello and thanks for your quick reply. I'm going to try to get a log from my host company.

I checked your topic, but it seems to be a different problem. When i try to upload, it gives almost instantly the error message, it's not that ajax keeps loading forever.

Thanks for the suggestion. I hope i can post the log soon.

Avatar
UncleCheese

Forum Moderator, 4096 Posts

20 January 2009 at 4:01am

Find out what the error is by turning on error reporting in _config.php

Debug::send_errors_to('myemail@address.com');

Then post the error here.

Avatar
cappelmans

Community Member, 6 Posts

20 January 2009 at 4:18am

Ok i received an error log, and i added the error reporting function, it gives some interesting errors. I will post them tonight, because i have to hurry now for an appointment. Thanks for the help sofar, much aprreciated.

Avatar
cappelmans

Community Member, 6 Posts

20 January 2009 at 9:56am

Ok, here are the error messages i received, trying to figure them out atm:

1:
Warning: copy() [function.copy]: open_basedir restriction in effect. File(/var/www/vhosts/stijlgoed.nl/httpdocs/assets/error.jpg) is not within the allowed path(s): (/var/www/vhosts/stijlgoed.nl/httpdocs:/tmp)
At line 232 in /home/vhosts/stijlgoed.nl/httpdocs/sapphire/filesystem/Folder.php

copy(/tmp/silverstripe-cache-var-www-vhosts-domain.nl-httpdocs/error.jpg,/var/www/vhosts/stijlgoed.nl/httpdocs/assets/error.jpg)
line 232 of Folder.php

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

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

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

Director::direct(admin/assets/index/0)
line 158 of main.php

2:
Warning: copy(/var/www/vhosts/stijlgoed.nl/httpdocs/assets/error.jpg) [function.copy]: failed to open stream: Operation not permitted
At line 232 in /home/vhosts/stijlgoed.nl/httpdocs/sapphire/filesystem/Folder.php

copy(/tmp/silverstripe-cache-var-www-vhosts-stijlgoed.nl-httpdocs/error.jpg,/var/www/vhosts/stijlgoed.nl/httpdocs/assets/error.jpg)
line 232 of Folder.php

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

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

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

Director::direct(admin/assets/index/0)
line 158 of main.php

3:
Error: File::loadUploaded: Couldn't copy '/tmp/silverstripe-cache-var-www-vhosts-stijlgoed.nl-httpdocs/error.jpg' to 'assets/error.jpg'
At line 236 in /home/vhosts/stijlgoed.nl/httpdocs/sapphire/filesystem/Folder.php

user_error(File::loadUploaded: Couldn't copy '/tmp/silverstripe-cache-var-www-vhosts-stijlgoed.nl-httpdocs/error.jpg' to 'assets/error.jpg',256)
line 236 of Folder.php

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

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

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

Director::direct(admin/assets/index/0)
line 158 of main.php

4:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/vhosts/stijlgoed.nl/httpdocs/assets/error.jpg) is not within the allowed path(s): (/var/www/vhosts/stijlgoed.nl/httpdocs:/tmp)
At line 225 in /home/vhosts/stijlgoed.nl/httpdocs/sapphire/filesystem/Folder.php

file_exists(/var/www/vhosts/stijlgoed.nl/httpdocs/assets/error.jpg)
line 225 of Folder.php

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

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

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

Director::direct(admin/assets/index/0)
line 158 of main.php

Avatar
UncleCheese

Forum Moderator, 4096 Posts

20 January 2009 at 10:41am

Yikes. That's a server config issue. Send it to your hosting provider to get the open_basedir restriction lifted.

Avatar
cappelmans

Community Member, 6 Posts

20 January 2009 at 10:48am

Thanks!

I will and keep you up-to-date if it worked.

Go to Top