WAMP 服务器不显示图像

发布于 2025-01-04 18:37:50 字数 552 浏览 1 评论 0原文

我遇到了一个问题,我不知道在谷歌中搜索什么。基本上我已经安装了 WAMP 服务器并安装了 OPen Cart

我可以在本地计算机上查看我的电子商务网站,但是当我在远程计算机上打开它时,它不会加载任何图像。它只显示文本

我的场景: 如果我加载 PHP 页面

http://192.168.1.101/

它工作正常。我可以查看放在根目录中的 WAMP 服务器页面,但是当我加载

http:// 的电子商务页面时192.168.1.101/clothing/

它不会加载图像。就好像 PHP 脚本不起作用一样。 时,它在我的本地计算机上运行良好

的是,当我浏览http://127.0.0.1/clothing/

有趣 寻求任何帮助!

I'm having a problem which I don't know what to search in google. Basically I have installed WAMP server and Installed OPen Cart

I am able to view my ECommerce site on my local computer but when I open it in on a remote computer it doesn't load any images. It only shows texts

My scenario:
if I load the PHP page at

http://192.168.1.101/

it works fine. I am able to view the WAMP server page which I put in the root directory but when i load the ecommerce pages at

http://192.168.1.101/clothing/

it doesn't load the images. As if the PHP scripts are not working on it. Funny thing is it works fine on my local machine when I browse

http://127.0.0.1/clothing/

Thanks for any help!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

入怼 2025-01-11 18:37:50

/config.php 中添加这些行(如果还没有):

// HTTP
define('HTTP_SERVER', 'http://192.168.1.101/clothing/admin/');
define('HTTP_CATALOG', 'http://192.168.1.101/clothing/');
define('HTTP_IMAGE', 'http://192.168.1.101/clothing/image/');

// HTTPS
define('HTTPS_SERVER', 'http://192.168.1.101/clothing/admin/');
define('HTTPS_IMAGE', 'http://192.168.1.101/clothing/image/');

记下地址 192.168.1.101 和目录名称 clothing。每次重命名目录或从不同地址访问站点时都必须更改它。

Add these lines (if isn't there yet) in <opencart main directory>/config.php :

// HTTP
define('HTTP_SERVER', 'http://192.168.1.101/clothing/admin/');
define('HTTP_CATALOG', 'http://192.168.1.101/clothing/');
define('HTTP_IMAGE', 'http://192.168.1.101/clothing/image/');

// HTTPS
define('HTTPS_SERVER', 'http://192.168.1.101/clothing/admin/');
define('HTTPS_IMAGE', 'http://192.168.1.101/clothing/image/');

Note the address 192.168.1.101 and directory name clothing. You have to change it everytime you rename the directory or access your site from different address.

汐鸠 2025-01-11 18:37:50

链接是如何形成的?您可能需要更改它们,因为它们似乎与您的本地主机绑定在一起(即,图像可能已链接: http:// /127.0.0.1/image_file.jpg)而不是相对的(即./image_file.jpg) - 这可以解释为什么当您更改 IP 地址时它不会出现。

How are the links formed? You probably need to alter them as it seems that they are tied to your localhost (ie. maybe images are linked: http://127.0.0.1/image_file.jpg) rather than being relative (ie. ./image_file.jpg) - which would explain why it isn't appearing when you change IP addresses.

挥剑断情 2025-01-11 18:37:50

我遇到了同样的问题,但我找到了解决方案,..是将要插入网页的图像保留到.folder.. C:\wamp\www
这样你的wamp服务器就可以找到定位的图像,然后这段代码将执行

I had same problem but i found the solution,..is that the image which you want to insert into your web page keep into.folder.. C:\wamp\www
so in this way your wamp server can find the located image then this code will execute<img src="exapmle.jpg" width="400" height="500" >

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文