Images do not show

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Images do not show

Postby kejo » 04. June 2019 06:45

Hello,
I am new to this site as well as xampp. I am having trouble with my images showing up in the browser in my localhost. I have loaded my files as:
htdocs/mysite/images/logo.png

All the text and css appear to be working fine. However, I am totally unable to get any images to appear even font awesome images. Under the apache config (httpd.conf) I updated the EnableMMAP file to the "on" setting which was off initially.

#EnableMMAP on
#EnableSendfile off

I am still unable to view any images. I would truly appreciate some help. I am at a total loss at this point.

Thanks,
kejo
kejo
 
Posts: 4
Joined: 04. June 2019 06:33
XAMPP version: 3.2.3
Operating System: Windows 7 ultimate

Re: Images do not show

Postby Altrea » 04. June 2019 07:31

Hi,

You must include images that way that a client browser can request them. So they need an relative/absolute URL, not a file path.
That is the same as for CSS and JS ressources too.

best wishes,
Altrea
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: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Images do not show

Postby Nobbie » 04. June 2019 10:38

kejo wrote: I have loaded my files as:
htdocs/mysite/images/logo.png


Leave out "htdocs" (simpy apply /mysite/images/logo.png instead, or better a full URL like http://localhost/mysite/images/logo.png), and then get yourself some basic tutorials about Apache and the meaning of DocumentRoot.

kejo wrote:I updated the EnableMMAP file to the "on" setting which was off initially.

#EnableMMAP on
#EnableSendfile off


That is plain nonsense, on the one hand it has nothing to do with your problem, on the other hand these options are commented out (the # in the first columns is a comment sign) and not active anyway. Why don't you read at least a basic documentation before you start fiddling around with the configuration?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Images do not show

Postby kejo » 05. June 2019 06:27

Hello,
"/mysite/images/logo.png" does not work. I tried that first. Everything I tried I read here on this site. Apparently, much of it is garbage.

I figured out a better solution(by fiddling around). Instead of screwing up my all my relative links and converting them to absolute links on all my webpages (which I would have to change all back when I uploaded to my actual server), I changed the root folder in xampp. I changed the file in C:\xampp\apache\conf\httpd.conf . I changed it from "C:/xampp/htdocs" to my actual root folder "C:/xampp/htdocs/mySite". This makes it function true to what will actually be uploaded to the server. Now it is picture perfect and the relative links display exactly the way it would on a live server. I will adjust the root folder for each project.
BTW fiddling around with "configurations" helps you to learn things in life. If all else fails and I cause the world to collide into the sun, and I kill every living creature on Earth, I will re-install and try again. No harm, no foul.
Thanks for all of your help. :)
kejo
 
Posts: 4
Joined: 04. June 2019 06:33
XAMPP version: 3.2.3
Operating System: Windows 7 ultimate

Re: Images do not show

Postby Nobbie » 05. June 2019 10:17

kejo wrote:Hello,
"/mysite/images/logo.png" does not work. I tried that first. Everything I tried I read here on this site. Apparently, much of it is garbage.


It should work, if you are not doing garbage like misspelling or so. Keep on fiddling until it works!
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 104 guests