Post by max05 » Mon Jul 31, 2017 6:43 am

Hello, everyone.

I have a shop on a shared server. 2 days ago my site stopped working suddenly, with an Error 500. It turned out my hosting provider changed their folder path structure, so I had to change the dir paths in my config.php (in the admin folder, too). After that my site worked again, except one thing: product images are not showing up. The logo shows up, but the product images are empty. I checked the source with firebug and the img src's are empty. The same happens when I view the products in the admin panel: no images appearing.
The hosting tech support suggested: "Please re-add the product images" which sounds ridiculous to me. I have hundreds of products with thousands of pictures. Does anyone have any idea what happened and how it could be fixed?

Opencart version: 2.3.0.2. / Single store.

Thank you!

Newbie

Posts

Joined
Mon Jul 31, 2017 6:31 am

Post by IP_CAM » Mon Jul 31, 2017 11:10 am

Well, one could possibly find out, where you screwed up, if you at least present
a Sitelink, and some links and paths out of your config.php files.
It could also be this <base href="{{ base }}" /> line in your
theme/template/common/header.tpl , not linking correctly, and just
to make sure, you could rewrite it to: <base href="http://www.yourshop .com/shop/" />
or whatever url you use...
And in your .htaccess file, you have this REWRITE LINE:
RewriteBase /
possibly required to be directed to your new Shop Sub, like i.E. /shop/:
RewriteBase /shop/
But as I usually say: No Figures = No Facts ! ::)
Ernie

I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Server Q & A Basic Information on Code + Settings
http://www.everyauction.info/serverinfo.html
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.jti.li/shop/
1'400+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by max05 » Tue Aug 01, 2017 5:09 am

IP_CAM wrote:
Mon Jul 31, 2017 11:10 am
Well, one could possibly find out, where you screwed up, if you at least present
a Sitelink, and some links and paths out of your config.php files.
It could also be this <base href="{{ base }}" /> line in your
theme/template/common/header.tpl , not linking correctly, and just
to make sure, you could rewrite it to: <base href="http://www.yourshop .com/shop/" />
or whatever url you use...
And in your .htaccess file, you have this REWRITE LINE:
RewriteBase /
possibly required to be directed to your new Shop Sub, like i.E. /shop/:
RewriteBase /shop/
But as I usually say: No Figures = No Facts ! ::)
Ernie
Thanks, Ernie. Yes, sorry, you are right I missed some important information.
Site : http://stylod.com/

Old config.php:
// DIR
define('DIR_APPLICATION', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/catalog/');
define('DIR_SYSTEM', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/');
define('DIR_IMAGE', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/image/');
define('DIR_LANGUAGE', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/catalog/language/');
define('DIR_TEMPLATE', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/catalog/view/theme/');
define('DIR_CONFIG', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/config/');
define('DIR_CACHE', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/storage/cache/');
define('DIR_DOWNLOAD', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/storage/download/');
define('DIR_LOGS', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/storage/logs/');
define('DIR_MODIFICATION', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/storage/modification/');
define('DIR_UPLOAD', '/hermes/bosnaweb13a/b1543/ipg.noonfashioncom/stylod/system/storage/upload/');

New config.php

// DIR
define('DIR_APPLICATION', '/home/users/web/b1543/ipg.noonfashioncom/stylod/admin/');
define('DIR_SYSTEM', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/');
define('DIR_IMAGE', '/home/users/web/b1543/ipg.noonfashioncom/stylod/image/');
define('DIR_LANGUAGE', '/home/users/web/b1543/ipg.noonfashioncom/stylod/admin/language/');
define('DIR_TEMPLATE', '/home/users/web/b1543/ipg.noonfashioncom/stylod/admin/view/template/');
define('DIR_CONFIG', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/config/');
define('DIR_CACHE', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/storage/cache/');
define('DIR_DOWNLOAD', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/storage/download/');
define('DIR_LOGS', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/storage/logs/');
define('DIR_MODIFICATION', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/storage/modification/');
define('DIR_UPLOAD', '/home/users/web/b1543/ipg.noonfashioncom/stylod/system/storage/upload/');
define('DIR_CATALOG', '/home/users/web/b1543/ipg.noonfashioncom/stylod/catalog/');

That's all that got modified, nothing else (stylod folder is the content of stylod.com) . After this modification, the images disappeared, as you can see.
.htaccess were never modified.

Do you have any idea?

Newbie

Posts

Joined
Mon Jul 31, 2017 6:31 am

Post by IP_CAM » Tue Aug 01, 2017 8:44 am

Well, your Product Listings contain no Image URL, for some unknown reason:

Code: Select all

<img src="" alt="Pinky White Marble Case for iPhone" .... />
<img src="" alt="Light Blue / Pink / Yellow Marble Case for iPhone" .... />
<img src="" alt="Wood Sunglasses (Black Lenses)" .... />
You have to check on, how they are saved/linked in the Database.
Ernie
---
Sample (OC v.1.5.6.x only!) DB Image Linking.
Image

Attachments

datanase_product_image_linking.jpg

datanase_product_image_linking.jpg (83.76 KiB) Viewed 3340 times


I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Server Q & A Basic Information on Code + Settings
http://www.everyauction.info/serverinfo.html
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.jti.li/shop/
1'400+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by max05 » Tue Aug 01, 2017 8:34 pm

As you can see, all the product images are linked correctly. There were no changes made in the database. I only modified the config.php server global paths and that's all.

I've just noticed when I try to upload a new photo in opencart admin, the image manager is fully empty. See the attached screenshot. When i try to create a folder with image manager, i get this error: "Warning: Directory does not exist!".

I'm really annoyed now. Does anybody have any idea what happened?

Attachments

Képernyőfotó 2017-08-01 - 14.31.10.png

Képernyőfotó 2017-08-01 - 14.31.10.png (17.2 KiB) Viewed 3319 times

Képernyőfotó 2017-08-01 - 14.26.24.png

Képernyőfotó 2017-08-01 - 14.26.24.png (145.8 KiB) Viewed 3319 times


Newbie

Posts

Joined
Mon Jul 31, 2017 6:31 am

Post by chris.dempsey » Mon Oct 02, 2017 8:00 pm

@max05 did you manage to resolve the issue?

I am experiencing the same symptoms following update from 1.5.6.4 to 2.3.0.2. Config DIR_IMAGE paths are correct as are database entries for product image path.

Update Turns out forward slashes cannot be used in paths in the config files in OC 2.3.0.2. My server accepts forward slashes in the paths generated during installation of 1.5.x (the installer ends up with a mix of back and forward slashes) hence I didn't immediately identify it as an issue when checking the config files.

New member

Posts

Joined
Wed Apr 04, 2012 6:43 pm

Post by djcarving » Mon Mar 19, 2018 4:13 am

The DIR_IMAGE path have to be absolute and will not follow symbolic links. Must be a php update that hardens the security rules.

Newbie

Posts

Joined
Mon Mar 19, 2018 4:11 am

Post by one2012 » Mon Jul 02, 2018 1:05 am

Guys, yo know, I have the same issue after moving my shop to the new hosting server. But I use OC3.0.2.0 version. All img tags have src="".

New member

Posts

Joined
Wed Feb 06, 2013 11:22 pm

Post by IP_CAM » Mon Jul 02, 2018 5:27 am

@max05: sorry for delay, it's a busy time here...
You missed to show us the Upper Part of the ROOT
config.php file, where your http/s - linking is configured.
Maker it look like below:

Code: Select all

<?php
// HTTP
define('HTTP_SERVER', 'http://stylod.com/');
define('HTTP_IMAGE', 'http://stylod.com/image/'); // IF HTTP_IMAGE EXISTS in your Setup !!
// HTTPS
define('HTTPS_SERVER', 'http://stylod.com/');
define('HTTPS_IMAGE', 'http://stylod.com/image/'); // IF HTTPS_IMAGE EXISTS in your Setup !!
And if you want to use HTTP Image linking, wich works more efficient as well,
to make it work for sure, read here about it:
Cookieless HTTP Domain Routing
https://www.opencart.com/index.php?rout ... n_id=23506
---
Ernie

I don't use Forum Mail, to reach me, contact: jti@jacob.ch
-
Server Q & A Basic Information on Code + Settings
http://www.everyauction.info/serverinfo.html
Demoversion OpenCart LIGHT v.1.5.6.5
http://www.jti.li/shop/
1'400+ FREE OC Extensions - from OC v.1.5.x up,
on the world's largest OC-related Github Site: https://github.com/IP-CAM
-
Image


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by tkao23 » Fri Aug 30, 2019 10:06 am

Kindly look carefully your admin/config.php
you may echo DIR_IMAGE, see got extra "/" or not.
For my case initially I have this `/home/opencart/oc3//image` after that I change to `/home/opencart/oc3/image` then everything work fine.

Newbie

Posts

Joined
Thu Jan 15, 2015 10:20 am
Who is online

Users browsing this forum: No registered users and 42 guests