php artisan storage:link
Sir I am a huge fan of yours, I am new in development but laravel filament helped me a lot to build applications. But just one thing, the storage link is not working in my case.. can you please assist me. I tried every document on the internet and everything. I am using cloud hosting from a hosting company called hostinger... On localhost everything was working fine but when I shifted to host. The storage link command is not working.
12 Replies
Laravel doesn’t work good on shared hosting. It’s better to use VPS.
Apart from that we need more info than „not working“
@Dennis Koch as mentioned in document of livewire. I put all files outside public-html. And all public folder files as per laravel directory I put in public-html, when I am running the command of php artisan storage link. It is throwing an error,
Even I tried it manually. But still it won't worked using this command
ln -s storage/app/public/customer-attachments public_html/storage/customer-attachments
It would help if you’d actually share that error. We can’t look into your machine.
Also you should link the whole public storage folder not just your subfolder
Seems like symlink is disabled by your Hoster. First result on google search
just use the correct ln -s and it will work.. like @Dennis Koch mentioned link the whole folder... and dont forget to remove the storage path from your public_html folder first 😉
but it is not working, i tried, and also symlink is enabled in hostinger @Dennis Koch
can u please guide me what will be the correct.? if u dont mind
ln -s storage/app/public public_html/storage
did you also symlink the public to the public_html?
normally you would first link the storage to the laravel public folder like this:
ln -s storage/app/public public/storage
after that link the public folder to the public_html which is being user by the shared hosting:
ln -s public public_html
as mentioned in document of livewire. I put all files outside public-html. And all public folder files as per laravel directory I put in public-html, when I am running the command of php artisan storage link. It is throwing an error,
Even I tried it manually. But still it won't worked using this command @Tally
this is also not working bro
hmmm what's the content of the public_html folder? you just copied the files over to the public_html folder?
maybe some DM to try to fix it... and then we can place the solution here 😉
all files are outside public _ html, and public folder files inside public_html
removed the storage dir in the public_html folder using
rm -R storage/
go up one dir
and run this command
ln -s $(pwd)/storage/app/public $(pwd)/public_html/storage
to create the correct symbolic link