Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 16 Feb 2007 14:12:14 +0100
From:      "Christian Walther" <cptsalek@gmail.com>
To:        "Roger Olofsson" <raggen@passagen.se>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: How to display .png?
Message-ID:  <14989d6e0702160512l1f8a18cbp3fd60120ae98026c@mail.gmail.com>
In-Reply-To: <45D59DB1.3000802@passagen.se>
References:  <45D59DB1.3000802@passagen.se>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16/02/07, Roger Olofsson <raggen@passagen.se> wrote:
> Dear Mailing List,
>
> As usual, thanks alot for all answers to my previous questions! I will
> try and step up and answer the ones I can.
>
> I'm still fiddling around with a machine that's upgraded to 6.2 and have
> encountered a small thing. Apache refuses to display .png pictures. This
> is probably some setting somewhere and I have looked in the following:
>
> httpd.conf of course
> php.ini
>
> I have reinstalled and checked options for php5, I have checked options
> and reinstalled gd and I have compared httpd.conf and php.ini with a
> FreeBSD 5.5, I have run phpinfo on both machines and compared the
> results, they look very much alike. The 5.5 displays .pngs fine though.
>
> I have also checked file permissions for the pictures, they all look
> fine. The output of httpd-error.log has no pointers.
>
> What could be the magic trick? Probably something really simple?
>

Apache doesn't display images, it just serves them. That is to say
they are downloaded to the browser like any other file is, and the
browser displays them.
So, what configuration are you using? From what you've given so far
you obviously have to different machines.
What about the ./htdocs tree, is it the same on both machines, e.g.
did you copy it from the 5.5 machine to the new one? Where is the
browser running? Is it running locally on the 6.2 machine, or do you
have a third machine from which you access both servers?
How do you access the png-Images? Are they embedded in a web page,
e.g.  by a <img src="" alt="" /> tag, or do you follow a link?

How does it look like in your web browser? Is the image missing
entirely, or do you have a "broken image" icon where you expect the
image to be? If there is such an icon, what are its properties? (If
you're using firefox you can right click on the image icon and select
properties.)
If there is no icon, does anything strange happen, e.g. does your
browser display weird lines of text, or does it open a save as-dialog?

What I think is possible is that there is a difference in the
mime-type definition of both servers. If a file is requested from a
web server the server sends a header that hopefully contains the right
mime type. Depending on the mime-type the browser decides what it can
do with it. So if there is no definition for png on your server, it
might either be sent as a text- or binary file, resulting in strange
behaviour in your web browser.

HTH
Christian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14989d6e0702160512l1f8a18cbp3fd60120ae98026c>