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
Dennis Koch
Dennis Koch7mo ago
Laravel doesn’t work good on shared hosting. It’s better to use VPS. Apart from that we need more info than „not working“
Sarthak Garg
Sarthak GargOP7mo ago
@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
Dennis Koch
Dennis Koch7mo ago
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
Sarthak Garg
Sarthak GargOP7mo ago
No description
Dennis Koch
Dennis Koch7mo ago
Seems like symlink is disabled by your Hoster. First result on google search
Tally
Tally7mo ago
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 😉
Sarthak Garg
Sarthak GargOP7mo ago
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
Tally
Tally7mo ago
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
Sarthak Garg
Sarthak GargOP7mo ago
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
Tally
Tally7mo ago
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 😉
Sarthak Garg
Sarthak GargOP7mo ago
all files are outside public _ html, and public folder files inside public_html
Tally
Tally7mo ago
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
Want results from more Discord servers?
Add your server