Images & Barcode not working when web hosted (Hostinger)
What I am trying to do:
I want the barcode from milon barcode to work properly and image to actually load. I can upload normally but it doesn't show the image in the tables.
What I did:
I tried running
php artisan storage:link
before uploading it to the hostinger files. It works locally, but on the hostinger it doesn't
Issues:
It works locally as shown in the images and does not in the hostinger when hosted despite running php artisan storage:link
before uploading
However, we're not in the part of public_html
folder, we just duplicated the public_html
and create a public
folder and we just uploaded the same exact files (the css wasn't working when that wasn't done and were not sure why). But the main issue really is the image and barcode not working properly.
Code:
barcode table column
Image upload in form
and Image column table
Tables\Columns\ImageColumn::make('image'),
10 Replies
ran the following commands?
npm run build
php artisan storage:link
You can check your browser console for CSP violations, APP_URL needs to be set correctly or CORS headers need to be adjusted maybeye u need to apply that symlink on production as well
And if i'm correct, filament uses the env var APP_URL to build the full url to an image, so this should be a correct value too on production
I get this error doing it in the ssh of the hostinger
Can you make a righ click on the missing image html symbol and klick "open in new tab".
And check if the requested url is correct
(Or in dev tools network tab...)
the image is still not found
Check image using ssh. Does it exist in public/storage folder?
check the imagick and gd extensions are installed
image related actions imagick and gd extensions are needed.
How to Manage PHP Extensions and Options | Hostinger Help Center
Managing PHP extensions and options at Hostinger
change storage folder permissions to 775
Chances are with something like hostinger or any shared hosting provider there is a permissions issue preventing the tmp uploaded file from being copied over to the storage directory.
Would be really surprised if this was a filament issue and not a host issue.