Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product images are not showing #2152

Closed
venkat402 opened this issue Jan 27, 2020 · 29 comments
Closed

Product images are not showing #2152

venkat402 opened this issue Jan 27, 2020 · 29 comments

Comments

@venkat402
Copy link

Bug report

On production, images are not loading
I followed the bellow site instructions
but still not resolved the issue
https://forums.bagisto.com/topic/188/broken-image-logo-in-bagisto-with-causes-and-solutions

Issue Description

on landing page
image

same on description page
image

Description helps the developers to understand the bug. It describes the problem encountered or some after effect of some kind.

Preconditions

Please provide as detailed information about your environment as possible.
I run all the commands bellow but still the issue not fixed at
composer update

php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache

composer dump-autoload
php artisan vendor:publish
php artisan storage:link

rm public/storage
php artisan storage:link

@rahulshukla-webkul
Copy link
Contributor

Hi @venkat402

Kindly clear your browser cache once, because we can see images - https://prnt.sc/qtdp68 and https://prnt.sc/qtdq4d.

@venkat402
Copy link
Author

Actually I fixed the issue by removing my custom package from the webkul packages
When I remove
"Webkul\SMS\": "packages/Webkul/SMS/src"
from psr-4 composer.json then it works fine
else
it is failing to show the images

@jitendra-webkul jitendra-webkul added the Help Wanted Extra attention is needed. label Jan 28, 2020
@nguyenndn
Copy link

image
@rahulshukla-webkul , @jitendra-webkul
I'm trying a clear cache browser many times, but I still get an error.
Why 'cache/small' or 'cache/original' or 'cache/medium' on URL image product?. I see the image uploaded on the Storage folder. Why we need 'cache/small/product' instead of 'storage/product' ?
Thanks.

@venkat402
Copy link
Author

venkat402 commented Mar 9, 2020

Hi, @keeloren
'cache/small' or 'cache/original' or 'cache/medium'
is for minimising image script for different screen lengths.
And getting over to this issue
In root run the bellow command
php artisan config:cache

@nguyenndn
Copy link

Hi @venkat402 , I'm using docker.
run php artisan config:cache.
image

but still gets an error.

image

where is 'cache/small' and why it includes to URL image :(

@rahulshukla-webkul
Copy link
Contributor

Hi @keeloren

Please follow the given link for solution - https://forums.bagisto.com/topic/188/broken-image-logo-in-bagisto-with-causes-and-solutions

@nguyenndn
Copy link

HI @rahulshukla-webkul , I try to run that command on the link solution. But it does not work :((

@rahulshukla-webkul
Copy link
Contributor

Hi @keeloren

Do the following things, from the root of your directory -

cd public

unlink storage

cd ..

php artisan storage:link

Thanks

@nguyenndn
Copy link

image
Hi @rahulshukla-webkul,
I follow this, but nothing has changed. So sad .
I spent a lot of time on this and wish to fix this. Thank you.

@nguyenndn
Copy link

image
In the Storage folder, I do not see the folder 'cache', or 'large'. But why 'cache/large' have been include URL image?
image

@rahulshukla-webkul
Copy link
Contributor

Hi @venkat402

Actually we are caching images in three different sizes.

Can you tell me , whats is your APP_URL in .env file ?

Is that - localhost::9000 or not.

Thanks

@nguyenndn
Copy link

HI @rahulshukla-webkul @venkat402 .

My APP_URL = http://localhost:9000

Please tell me to know where the folder has caching images in three different sizes? Thanks.

@venkat402
Copy link
Author

Change APP_URL =http://localhost/project_name/public/

@nguyenndn
Copy link

nguyenndn commented Mar 10, 2020

Hi @venkat402 @rahulshukla-webkul
I solved it. Many thank for support :)

@MothanaDo
Copy link

Hi @venkat402 @rahulshukla-webkul
I solved it. Many thank for support :)

how u r solve it :(

@MothanaDo
Copy link

when i run : composer dump-autoload

Generating optimized autoload files
Deprecation Notice: Class Webkul\Admin\DataGrids\CartRuleCouponsDataGrid located in ./packages/Webkul/Admin/src/DataGrids/CouponsDataGrid.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Shop\TriggerCest located in ./tests/trigger/Shop/TriggerCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Shop\DatabaseLogicCest located in ./tests/trigger/Shop/DatabaseLogicCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Webkul\Admin\ProductCest located in ./tests/functional/Admin/Catalog/ProductCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Catalog\AttributeFamilyCest located in ./tests/functional/Admin/Catalog/AttributeFamilyCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Catalog\AttributeCest located in ./tests/functional/Admin/Catalog/AttributeCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Catalog\CategoryCest located in ./tests/functional/Admin/Catalog/CategoryCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Sales\InvoiceCest located in ./tests/functional/Admin/Sales/InvoiceCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Sales\RefundCest located in ./tests/functional/Admin/Sales/RefundCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Sales\OrderCest located in ./tests/functional/Admin/Sales/OrderCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Sales\ShipmentsCest located in ./tests/functional/Admin/Sales/ShipmentsCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Customer\GroupsCest located in ./tests/functional/Admin/Customer/GroupsCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Customer\CustomerCest located in ./tests/functional/Admin/Customer/CustomerCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Customer\NewsletterSubscriptionCest located in ./tests/functional/Admin/Customer/NewsletterSubscriptionCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Admin\Customer\ReviewCest located in ./tests/functional/Admin/Customer/ReviewCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Shop\ProductControllerCest located in ./tests/functional/Shop/ProductControllerCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Shop\GuestCheckoutCest located in ./tests/functional/Shop/GuestCheckoutCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Cart\CartTaxesCest located in ./tests/functional/Shop/CartTaxesCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Checkout\Cart\CartCest located in ./tests/functional/Checkout/Cart/CartCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Functional\Checkout\Cart\OrderCest located in ./tests/functional/Checkout/Order/OrderCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Acceptance\GuestCheckoutCest located in ./tests/acceptance/GuestCheckoutCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Category\CategoryCest located in ./tests/unit/Category/CategoryCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Core\CoreCest located in ./tests/unit/Core/CoreCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Product\Helpers\ProductTypeCest located in ./tests/unit/Product/Helpers/ProductTypeCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Checkout\Cart\Models\CartModelCest located in ./tests/unit/Checkout/Cart/Models/CartModelCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Checkout\Cart\Controllers\CartControllerCest located in ./tests/unit/Checkout/Cart/Controllers/CartControllerCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Deprecation Notice: Class Tests\Unit\Tax\Helpers\TaxCest located in ./tests/unit/Tax/Helpers/TaxCest.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:201

Illuminate\Foundation\ComposerScripts::postAutoloadDump
@php artisan package:discover

In PackageManifest.php line 177:

The /home/bagisto/public_html/bagisto/bootstrap/cache directory must be pre
sent and writable.

Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

@riwash
Copy link

riwash commented Apr 13, 2020

make ur env url right like this APP_URL=http://localhost/project/multi-use/sham-ecommerce/public/

@sebastien15
Copy link

the other thing that helped me through my three days journey is to manually delete storage folder in public folder and then do php artisan storage:link

@vivekshubhu
Copy link

@venkat402 Actually I've got the same problem. I run all the commands above and also changed app_url as above. but it does not work.

1

@venkat402
Copy link
Author

venkat402 commented May 25, 2020 via email

@farshadff
Copy link

any fix for this ?? when moving image files from one host to another this happens i did all above but still the images wont load they load in admin panel but not front shop

@riwash
Copy link

riwash commented Jun 4, 2020

php artisan storage:link this every time if u move folder it work or u can change upload image file location to public

@farshadff
Copy link

@riwash no i tried that this didnt solve it for me

@chiendv
Copy link

chiendv commented Jul 21, 2021

Hi,
I get stuck in this error when running Bagisto with nginx and reserve-proxy (client -> proxy(port 80) -> nginx (port 83) )

Nginx is running at port 83 and root is point to bagisto public directory.

APP_URL=http://domain.com

php artisan storage:link said
The [/var/www/html/xxx/public/storage] link has been connected to [/var/www/html/xxx/storage/app/public].

images are good in admin but not show in frontend.

any help please!

@devansh-webkul
Copy link
Member

Hi @chiendv,

There are possibly only two reasons,

@chiendv
Copy link

chiendv commented Jul 21, 2021

Hi @devansh-webkul,
Thanks for you quick response.

I has resolved it by check config of nginx and comment out config lines for cache static files

        #location ~* \.(jpg|jpeg|png|gif|ico|mp3|mp4|mov)$ {
        #       expires 30d;
        #}

Hope it can help other people with this kind of issue.

@merdiano
Copy link

Hi @devansh-webkul,
Thanks for you quick response.

I has resolved it by check config of nginx and comment out config lines for cache static files

        #location ~* \.(jpg|jpeg|png|gif|ico|mp3|mp4|mov)$ {
        #       expires 30d;
        #}

Hope it can help other people with this kind of issue.

what if i want to cache statick files?

@devansh-webkul
Copy link
Member

We are using the default Laravel configuration and mostly these are cached. If you need to customize you can feel free to do it at your instance.

@williamagyapong
Copy link

I was happy when I found this discussion after running into the same issue of products images not showing, however, none of the suggestions given here does seem to work for me. Any other help will be greatly appreciated. Below is a screenshot:

Screen Shot 2021-10-27 at 3 15 20 PM

@ghermans ghermans removed the Help Wanted Extra attention is needed. label Oct 28, 2021
@bagisto bagisto locked and limited conversation to collaborators Oct 28, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests