Skip to content
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 Image Won't Show #17

Closed
joeprabawa opened this issue Jan 1, 2019 · 24 comments
Closed

Product Image Won't Show #17

joeprabawa opened this issue Jan 1, 2019 · 24 comments

Comments

@joeprabawa
Copy link

Hi, i got this issue after upload the product image. I've opened up the console
and it showing this error message :
GET http://127.0.0.1:8000/storage/2/conversions/01-thumbnail.jpg 404 (Not Found)

screencapture-localhost-8000-admin-product-2019-01-01-18_58_28

The preview image didn't showed up, both from the admin panel and from the client
Need a guide to fix this problem. Thank you so much in advance :)

@fulopattila122
Copy link
Member

You have to run php artisan storage:link

https://laravel.com/docs/5.7/filesystem#the-public-disk

@fulopattila122
Copy link
Member

Did it solve the problem?

@cfrisly
Copy link

cfrisly commented Jan 3, 2019

I also have a similar problem with the images does not show them in admin and the store if I have the storage folder

@fulopattila122
Copy link
Member

fulopattila122 commented Jan 3, 2019

@cfrisly Did you try php artisan storage:link?

@joeprabawa
Copy link
Author

halo @fulopattila122, i already did the command. it said The "public/storage" directory already exists

@joeprabawa joeprabawa reopened this Jan 3, 2019
@fulopattila122
Copy link
Member

fulopattila122 commented Jan 3, 2019

Generally it's not a Vanilo but a filesystem/permission problem, but I'll try to help.
What answer do you get when you right click the broken image and click open in new tab? Is it 404 or 403?
What do you see in your log files at the same time?
How do you run your web server, via php artisan serve or via nginx or apache maybe homestead or docker?
Does the user running the web server have permission to read from those folders?
Does the problem apply to newly uploaded images as well or only to those previously uploaded?

@joeprabawa
Copy link
Author

joeprabawa commented Jan 3, 2019

@fulopattila122 thank you so much for the help.

  1. it's 404 with this url http://127.0.0.1:8000/storage/3/01.jpg
  2. On the console it says GET http://127.0.0.1:8000/storage/3/conversions/01-thumbnail.jpg 404 (Not Found)
    3 & 4. I use php artisan serve with basic phpmyadmin root config
  3. Applied to all images

@fulopattila122
Copy link
Member

fulopattila122 commented Jan 3, 2019

What's the output of

stat public/storage

?

Btw what OS are you using?

@joeprabawa
Copy link
Author

screenshot_1

I got that, i'm using windows 7

@fulopattila122
Copy link
Member

Windows 😶

The problem is that Laravel saves the file into storage/app/framework/public, whereas public/storage should be a symlink to ../storage/app/public but as far as I see it's a regular file.

It should be like this:

fulop@asus-UX303LA  vanilo/demo   master  stat public/storage 
  File: public/storage -> ../storage/app/public
  Size: 21        	Blocks: 0          IO Block: 4096   symbolic link
Device: 802h/2050d	Inode: 7082242     Links: 1
Access: (0777/lrwxrwxrwx)  Uid: ( 1000/   fulop)   Gid: ( 1000/   fulop)
Access: 2019-01-03 12:20:50.283873521 +0100
Modify: 2018-06-26 22:07:59.484280669 +0200
Change: 2018-06-26 22:07:59.484280669 +0200
 Birth: -

Windows symlinks are out of my expertise, so I suggest to take a look at these issues:
laravel/framework#15439
spatie/laravel-medialibrary#1275

@fulopattila122
Copy link
Member

💡 my last tip: you may try to delete public/storage (only if it's empty) and run php artisan storage:link again.

@joeprabawa
Copy link
Author

joeprabawa commented Jan 3, 2019

Thanks for refrenced the issue on the spatie @fulopattila122, i red the comments there, and yes ! i already did your method a moment ago, it works ! 😄

thank you so much for your help !!! Vanilo Rocks

@fulopattila122
Copy link
Member

Cool to hear! rock&roll ;) 🤘

@allawliet
Copy link

Hye, i have tried delete the storage and run the command again but still not working..can someone help me..

@fulopattila122
Copy link
Member

fulopattila122 commented Jun 27, 2019

@allawliet
What's the output of

stat public/storage

?

What OS are you using?

@allawliet
Copy link

it show the same as you show

my

@allawliet
Copy link

and i am windows hahaha

@fulopattila122
Copy link
Member

What does the Browser give you when you try to open the image directly?
(Right click the broken image and "Open Image in new Tab")
404 or 403, or ...?
Also what do you see in your logs?

@allawliet
Copy link

the error is 404 and there is nothing in my logs
my2

@fulopattila122
Copy link
Member

What is the URL of the broken image?

@allawliet
Copy link

@allawliet
Copy link

Hye...i got it..i change the APP_URL and thank god its working =)
Thank you for your help !!

@fulopattila122
Copy link
Member

Exactly :)

@Niz47
Copy link

Niz47 commented Jun 2, 2020

Hye...i got it..i change the APP_URL and thank god its working =)
Thank you for your help !!

Hey man, you saved my time. Thanks a million :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants