Post by geadasbezz » Wed Dec 13, 2017 10:53 pm

urgent help

my online store has stopped showing all the images

How can I solve this problem
Image

Image

Newbie

Posts

Joined
Thu May 11, 2017 6:54 pm

Post by straightlight » Wed Dec 13, 2017 11:00 pm

Non-English screenshots, topic posted on an English section. No OC version provided.

Change your CHMOD settings from your FTP root image folder to 0755 or 0777 recursively. Also ensure your image path is properly configured from your config.php and admin/config.php files and that your SEO links from your view source are accurate when using SSL versus non-SSL. This should resolve the issue.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by MrPhil » Thu Dec 14, 2017 9:49 am

The usual cause is that someone turned on "hotlink protection", without "whitelisting" your own site. That is, all requests for image formats are "failed" unless the requesting domain is approved. Check your .htaccess file to see if there is anything like ... - [F] in there. Did anything just change in your setup that you know of, such as domain name change, or changing to SSL? You would have to update any .htaccess entry that already existed for hotlink protection.

Someone could also have fooled with permissions. All directories below public_html should normally be 755 permissions, although that can vary by host. Do NOT chmod them to 777 unless you know exactly what you're doing! That is ONLY if PHP runs as "world/other" user AND PHP needs to write to that directory. Image files themselves are normally 644, but that can vary by host. Check your site error log to see if you're getting a ton of error messages logged for access denied.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm

Post by straightlight » Thu Dec 14, 2017 9:53 am

Do NOT chmod them to 777 unless you know exactly what you're doing!
That assumption is correct. Although, there are also hosts that may still not allow to write with CHMOD 755. CHMOD 777 may be insisted for some cases.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by DigitCart » Thu Dec 14, 2017 1:01 pm

Hi,
I experienced same problem a few days ago.
After review, I realized that the absolute path of the hosts has changed from home to home2
I had these in the config.php file:

Code: Select all

/home/mysite/public_html/catalog/
I changed to:

Code: Select all

/home2/mysite/public_html/catalog/
And the problem was solved.

Of course, your problem may be something else.
If you want to test this item, temporarily edit these two files:

admin\model\tool\image.php
catalog\model\tool\image.php

and remove this part:

Code: Select all

 || substr(str_replace('\\', '/', realpath(DIR_IMAGE . $filename)), 0, strlen(DIR_IMAGE)) != str_replace('\\', '/', DIR_IMAGE)

My Extensions


User avatar
Active Member

Posts

Joined
Thu Jun 22, 2017 5:32 pm


Post by MrPhil » Thu Dec 14, 2017 11:17 pm

A host really ought to tell you when they've changed your directory structure (e.g., /home becomes /home2). I'm surprised that the rest of the code and files worked and only the images failed, if that's the cause. In fact, "hotlink protection" doesn't normally care about the path (in .htaccess), just the domain name and the file extension.

User avatar
Active Member

Posts

Joined
Wed May 10, 2017 11:52 pm
Who is online

Users browsing this forum: No registered users and 43 guests