Page 1 of 1

Images do not show

PostPosted: 04. June 2019 06:45
by kejo
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

Re: Images do not show

PostPosted: 04. June 2019 07:31
by Altrea
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

Re: Images do not show

PostPosted: 04. June 2019 10:38
by Nobbie
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?

Re: Images do not show

PostPosted: 05. June 2019 06:27
by kejo
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. :)

Re: Images do not show

PostPosted: 05. June 2019 10:17
by Nobbie
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!