png images display error on localhost

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

png images display error on localhost

Postby riverdiggidy » 19. September 2011 20:09

Hello,
I have been working on some tutorials and on all the source files the images are .gif. I found that if i ran the file without being connected to the localhost the image would display no problem, so i knew it was not a path error. However, every time i would connect to the localhost, the images would not display. Finally i converted the .gif to a jpg, and edited the source code a little and magically it worked.
So for some reason xampp is not working with .gif files. I figure this is some kind of configuration but have no idea where to look.
Has anybody seen something similar?
riverdiggidy
 
Posts: 2
Joined: 19. September 2011 19:06

Re: png images display error on localhost

Postby Altrea » 20. September 2011 05:23

Your topic is about png Images, your text about gif images :shock:
You are writing about error messages but don't post the error message here.
You have to be much more clear to get good help. Remember, we don't see what you see. We don't know your system, folder structure, requests, etc etc.

With your information i just can say, that MY .gif, .jpg, .png images are working fine with XAMPP independed of if i request them with localhost or other ways.

Maybe we should start with the basics:
- OS version?
- XAMPP version?
- which Browser?
- XAMPP is installed in which folder?
- what do you type in your browser bar to get the error?
- What does your sourcecode look like?
- What is the text of the error message?

Thats the MINIMUM of Information we need.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: png images display error on localhost

Postby riverdiggidy » 20. September 2011 18:19

Hello,
Thank you for helping me to clarify my post. First off i did make the mistake of putting png in the title, and then later realize that it was gif files i was having issues with.
I am running Xampp Mac OS X Version. My root folder is my sites folder. Located at /Users/Trav/Sites. So for example, one of the sites paths is /localhost/~Trav/NewHorizon/Chapter05/header.php
In this folder Chapter five, i have the file header.php, along with my images: logo.gif, logo.jpg, s-logo.gif, s-logo.jpg
A snip-it of this header.php file is as follows.

<table width="100%" cellpadding="12" cellspacing="0" border="0">
<tr bgcolor="black">
<td><img src="logo.gif" /></td>
<td>
<h1>TLA Consulting</h1>
</td>
<td align="right"><img src="logo.gif" alt="TLA logo" height=70 width=70></td>
</tr>
</table>
<!-- menu -->
<table width="100%" bgcolor="white" cellpadding="4" cellspacing="4">
<tr >
<td width="25%">
<img src="s-logo.jpg" alt="" height=20 width=20> <span class="menu">Home</span></td>
<td width="25%">
<img src="s-logo.jpg" alt="" height=20 width=20> <span class="menu">Contact</span></td>
<td width="25%">
<img src="s-logo.jpg" alt="" height=20 width=20> <span class="menu">Services</span></td>
<td width="25%">
<img src="s-logo.jpg" alt="" height=20 width=20> <span class="menu">Site Map</span></td>
</tr>
</table>

When i run the code i would receive no error, simply the images would not display. I would just get the broken image icon in all browsers.
I then saved those .gif files as .jpg files, and edited my code slightly and the images would display.
riverdiggidy
 
Posts: 2
Joined: 19. September 2011 19:06

Re: png images display error on localhost

Postby JonB » 21. September 2011 09:54

Located at /Users/Trav/Sites. So for example, one of the sites paths is /localhost/~Trav/NewHorizon/Chapter05/header.php


localhost's folder path BEGINS at the DocumentRoot - probably htdocs == /Users/Trav/Sites

i.e http://localhost/NewHorizon/Chapter05

Look in your httpd.conf for the value of DocumentRoot

~Trav is part of the local filesystem (normally, '~' {the tilde} says where the user Home is) UNLESS you created a folder called ~Trav under Sites - which would be a poor practice at any rate.

Good Luck
8)

sfb
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7


Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 10 guests