【发布时间】:2014-05-30 01:30:15
【问题描述】:
我有 OpenCart 1.5.5.1 并尝试更改图像文件夹但结果出乎意料。
我的opencart安装在www.example.com/opencart/
我修改了config.php和admin/config.php如下:
// HTTP
define('HTTP_SERVER', 'http://example.com/opencart/');
// HTTPS
define('HTTPS_SERVER', 'https://example.com/opencart/');
// DIR
define('DIR_APPLICATION', '/home/example/public_html/opencart/catalog/');
define('DIR_SYSTEM', '/home/example/public_html/opencart/system/');
define('DIR_DATABASE', '/home/example/public_html/opencart/system/database/');
define('DIR_LANGUAGE', '/home/example/public_html/opencart/catalog/language/');
define('DIR_TEMPLATE', '/home/example/public_html/opencart/catalog/view/theme/');
define('DIR_CONFIG', '/home/example/public_html/opencart/system/config/');
define('DIR_IMAGE', '/home/example/public_html/opencart/image2/');
define('DIR_CACHE', '/home/example/public_html/opencart/system/cache/');
define('DIR_DOWNLOAD', '/home/example/public_html/opencart/download/');
define('DIR_LOGS', '/home/example/public_html/opencart/system/logs/');
当我现在查看该站点时,所有图像都消失了,不是损坏了,而是消失了。 将文件夹名称更新为“image2”后,图像显示已损坏,当我查看图像 URL 时,我看到:
http://example.com/opencart/image/data/Logos/logo.png
所以不知何故它仍在寻找“图像”文件夹。
当我将图像文件夹移到 opencart 文件夹之外时,它变得更加奇怪,例如从/home/example/public_html/opencart/image2/ 到/home/example/public_html/image2/
那么图片url还是:
example.com/opencart/image/data/Logos/logo.png
当我将 config.php 中的 HTTP_SERVER 行更改为 http://example.com/opencart2
图片仍然损坏,但图片网址现在是:
example.com/opencart2/image/data/Logos/logo.png
谁能告诉我我做错了什么?我是否太天真地认为 DIR_IMAGE 定义指向图像所在的文件夹?
无论如何,我这样做的原因是我希望两个 opencart 商店共享同一个图像文件夹。所以: 1号店:
/home/example/public_html/opencart/
2号店:
/home/example/public_html/opencart2/
图片文件夹:
/home/example/public_html/image/
有什么办法吗?
提前致谢
【问题讨论】:
-
您是否更新了两个配置文件中的图像文件夹路径?
-
是的,我做到了,config.php 和 admin/config.php 显示相同