Page 1 of 2
Displaying jpeg files through apache server
Posted: Thu Nov 16, 2006 11:21 am
by normano
Hi having a very strange problem, have had apache set up with mysql and php for a couple of weeks now in order to learn php databasing etc, thought everything was working fine, managed to make a few complicated(ish) scripts which run correctly. The problem came when I tried to dispaly jpeg files. Some wern't being recognised at all. Large ones were not completely drawing. One thing I have noticed is that the ones that don't draw at all have all been taking by digital cameras of varying names.
I'm confused, anyone have any ideas?
Thanks Ben
Posted: Thu Nov 16, 2006 11:28 am
by Burrito
my first guess...permissions.
Posted: Thu Nov 16, 2006 11:57 am
by normano
as in apache permissions? how do I change them?
Posted: Thu Nov 16, 2006 12:03 pm
by Burrito
as in permissions on the files. The web user needs to have read permissions on the files.
you'll use
chmod to change file permissions.
you can determine the files' permissions by changing the the directory they're in and using 'ls -la'
Posted: Thu Nov 16, 2006 1:09 pm
by RobertGonzalez
What is your OS?
Posted: Thu Nov 16, 2006 1:57 pm
by normano
xp prof media centre and i don't think its the permissions or it wouldn't half load the files.
Posted: Thu Nov 16, 2006 1:59 pm
by normano
Have talked to quite a few people about this now, best answer I've had is reinstall, think that's the way to go? Would be (incredibly) annoying if I went through that and it didn't fix it.
Posted: Thu Nov 16, 2006 2:49 pm
by feyd
Reinstall what, Windows? That's ludicrous.
Posted: Thu Nov 16, 2006 3:10 pm
by RobertGonzalez
What I would do is save your jpeg files as GIF and PNG (yes, both types) then try running your app with those images instead of JPEG images (as a benchmark). Next, I would load a static HTML page with images in them (all three types of images) and run them from the localhost to test if this is truly an apache thing or not.
Posted: Thu Nov 16, 2006 3:13 pm
by Burrito
I'm still leaning hard toward permissions, I've heard nothing to steer me away from that yet....
Posted: Thu Nov 16, 2006 3:19 pm
by normano
tried the different types, ie the 3 mentioned, having converted them (the files which wern't loading) they do load, but only to a size limit (this is under the size of a 1024 by 768 wallpaper) Its loads the top up to a certain point (not totally sure what size this is) but fails to get all the way down the image, resulting in black towards the bottom.
Posted: Thu Nov 16, 2006 3:22 pm
by RobertGonzalez
Now load them in your browser directly (File -> Open -> <filename_of_image>. Does that change the behavior?
@Burr = I would tend to agree with except that the poster is on a Windows machine. Typically this results in open permissions by default. I'm not counting permissions out, I'm just thinking it might be something else.
Posted: Thu Nov 16, 2006 3:23 pm
by Burrito
ok, so they all draw partially now? If so, then the permissions issue is out the window.
can you open the images with your browser straight from the filesystem....in other words file:///...
that won't pass through your web server and will help eliminate that as a potential issue. Can you open the images with another application and do they work there? Is this happening with one browser type but not another?
edit: quick draw mcgraw everah...quick friggin' draw mcgraw.
Posted: Thu Nov 16, 2006 3:26 pm
by Burrito
Everah wrote:Typically this results in open permissions by default...
save an image to your desktop then copy it to your wwwroot folder

... I do this all the time and forget to grant permissions to IUSR
Posted: Thu Nov 16, 2006 3:26 pm
by feyd
How, specifically, are you displaying these files? Is it through a script? Are you using GD to dynamically process them upon request?