Page 1 of 1

Image loading problem

PostPosted: 10. March 2020 07:09
by Drachsi
I have a dev website running one pc, and can see the website when I access from a second pc on my home network. The only problem is, the images do not show on the second pc.

I checked the image by right clicking and see this message

Requested URL http://localhost:80/website/wp-content/ ... ed-faq.png
Physical Path C:\inetpub\wwwroot\website\wp-content\uploads\2020\02\red-faq.png

How can I correct the problem?

Regards
Drachsi

Re: Image loading problem

PostPosted: 10. March 2020 08:24
by Altrea
localhost does only work from the very own pc the webserver is running on.
If you want to reference images, css files, js files, etc you need to use an url every client machine can use (e.g. the public network ip address).

Re: Image loading problem

PostPosted: 10. March 2020 14:43
by Drachsi
Hi,

Why does everything work, scripts, plugins etc, but not images on the 2nd pc?

Regards
Drachsi

Re: Image loading problem

PostPosted: 10. March 2020 15:15
by Altrea
Because php code, plugins etc are processed by the server (server side programming language), asset files like CSS, JS, images are side requests fired by the clients browser.

Re: Image loading problem

PostPosted: 10. March 2020 17:27
by Nobbie
Drachsi wrote:Why does everything work, scripts, plugins etc, but not images on the 2nd pc?


Because your images are NOT linked via a valid URL (like http://www.blabla.com/website/image.png), but instead you applied a pathname ( C:\inetpub\wwwroot\website\wp-content\uploads\2020\02\red-faq.png). And a pathname does not contain any domain name or servername, therefore the browser has no idea from which server to request the image, there is no request send to any server, the browser simply tries to open that pathname on the PC where the browser is running. And of course, on that client PC there is no such image, these are on the Xampp server.

Re: Image loading problem

PostPosted: 11. March 2020 06:32
by Drachsi
Ok,
Many thanks for the answer, solve some problems.

Regards
Drachsi

Re: Image loading problem

PostPosted: 11. March 2020 06:35
by Altrea
Maybe you want to provide us information about what the real problem was and how you solved it!?

Re: Image loading problem

PostPosted: 11. March 2020 10:13
by Drachsi
Hi,

The basic problem is the same, but as I thought it was I creating the no image showing, spent time in the wrong area.

Thanks for the support.

Regards
Drachsi