WAMP Server not displaying images

家住魔仙堡 提交于 2019-12-02 12:29:55

问题


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!


回答1:


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.




回答2:


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.




回答3:


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" >



来源:https://stackoverflow.com/questions/9240135/wamp-server-not-displaying-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!