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

Image not shown on pages and in administraton


Go to End


18 Posts   8629 Views

Avatar
Sirius

Community Member, 7 Posts

18 August 2008 at 5:50am

Edited: 18/08/2008 8:11am

Thanks for your fast replys ;0) Hopefylly we will find a solutionfor this problem.

Try out my test installation:

I started from scratch with a test installation.

PHP info: http://sirius.web.surftown.dk/phpinfo.php

I am using SS version 2.2.2 (just downloaded + a clean install)

Admin-access: http://sirius.web.surftown.dk/admin/

User: admin
Password: password

Website: http://sirius.web.surftown.dk/

Status so far:

1. I have tried to paste the the url from the properties dialog box into my browsers address and i dosen't work.

2. I have tried to change the path to the missing image by right click + insert/edit link and write the url directly to the SilverStripeLogo.png file.

3. I can confirm that GD2 extension is installed on my webserver.

4. I cannot from the filesystem in SS browse the file path shown in properties dialog.

5. The Upload folder has file permission 777. And I have tried file permissions 644, 755 and 777 on the upload folder and the resampled folder aswell.

Avatar
pac

Community Member, 25 Posts

18 August 2008 at 6:13am

ok....
I uploaded and image through the cms
http://sirius.web.surftown.dk/assets/Uploads/card1643.JPG?r=338221234
inserted the image on the about us page.
no worries so far
shows in the admin as full image but not as thumbnail
it does appear that the image is not _resampled folder, worth checking through ftp.
Could be an ownership rather than permission problem on that folder ? can the web server write to it ?
try creating new folders on files and images in the cms and check permissions and ownership, I guess.
It does work for me on my sites, with this little glitches on permissions everytime I create a new folder/gallery.

Avatar
Sirius

Community Member, 7 Posts

18 August 2008 at 6:47am

Edited: 18/08/2008 7:57am

Thanks,

I will try to play with ownership and filepermissions.

Avatar
pac

Community Member, 25 Posts

18 August 2008 at 8:10am

hope you figure it out.
let me know.
In the meantime, I'll be exploring the source code to find out where this damn mkdir call is done and will try to modify the code to adjust permissions/ownership. Obviously this only happens on certain installations. I use apache2 on gentoo, which apparently is not your case.
Hopefully we'll work it out ourselves, as the developers have been quite unresponsive on that one. But hey, they're doing great work anyways, we just need more people in the community

Avatar
pac

Community Member, 25 Posts

18 August 2008 at 8:40am

well this is odd.
I did find a method

 	public static $file_create_mask = 02775;  
which seems to be used systemwide for file/folder creation.

but it isn't for the _resampled folder which returns a 744 permissions as it is created and does not seem to use any mkdir function, rather a ereg_replace function.

there is a

 		static function find($filename) {
		// Get the base file if $filename points to a resampled file
		$filename = ereg_replace('_resampled/[^-]+-','',$filename);
	}

in sapphire/filesystem/File.php which could trigger the creation of the folder, but I'm not sure.
Anyway, in my case, and from what I've read in the forums, a few others, the permissions on that _resampled folder causes the problem. Should be 755 not 744.

Anyone in the core team to give us a hint/solution ? Should we submit a ticket with Syrius' and this permission issue ?

thanx in advance

Avatar
Sirius

Community Member, 7 Posts

18 August 2008 at 10:00am

If I am using file permission 755, I can't upload images to the current folder.

Avatar
pac

Community Member, 25 Posts

18 August 2008 at 10:21am

yes you can. As I showed in an earlier post, they are uploaded to your server, but not to _resampled folder. In my case they are, but they don't show, in your case they seem not to be created there. Once again, it' worth double checking with ftp, but unless your htacess is totally f***ed up, they aren't.
The only thing I can think of is an owner/permission issue, as you obviously meet requirements but since the code is not really well documented on that part, CoreTeam, Help Needed !!!

Avatar
rbquirke

Community Member, 70 Posts

4 September 2008 at 3:34pm

Hi folks

I have been seeing the same issue.

My scenario is as follows:
1) Server 1: images are uploaded fine, resized fine

2) Server 2: Images did not upload at first, I then set the directory perms of the assets/Uploads directory to 766 and the images are now being uploaded. They are not however, being resized. Nothing is getting created in the _resampled directory.

The main difference between the two servers is the user the scripts are being run under. In server 1, the php scripts are being run under the site/ftp user for that user. I can tell this as the uploaded files have that file owner on the directory listing. There are no permissions issues here as the user that is creating/writing the files owns the directories.

In server 2 (lets call him the problem child!), the scripts are running under the apache user.
As I have set the directory permissions to 766, the script can upload and write the file to the Uploads directory, but for some reason, the resize/resample function calls are not writing anything to the _resampled directory.

There must be a difference between the Upload image function and resizing function and that is why one works and the other does not.

Possible solutions:
1) see if you can get Apache to run your scripts as the user that owns the Silverstripe directories
2) Check back here and see if I have found something in the code later in the week.

Can anyone confirm my theories above? I may be completely wrong of course, it happens a lot.