I've setup my production server on a shared hosting my directory structure looks like this (my project is placed at same level as public):
/home/user/my-laravel-project/
/home/user/public_html
This is how I'm storing my data in Storage > Public Disc
$data->store('path/to/data', 'public');
On production, using SSH, when I run this command php artisan storage:link
.
It creates a symlink between storage/app/public
and my-laravel-project/public
I want this link to be created between storage/app/public
and /home/user/public_html
What I've tried
my-laravel-project/public
then tried php artisan
storage:link
.. it failed with an error No file or directory
storage_path('app/public)
to
public_path()
under config/filesystem.php
but no successln -nsf
/home/user/my-laravel-project/storage/app/public
/home/user/public_html
but no successTried many other little tweaks but nothing works for me .. I'm looking for a proper solution to create a symlink between storage/app/public
and /home/user/public_html
on my shared server
Note I don't want to change paths in config/filesystems.php
as that's not a proper solution
My current server is setup on Siteground with php version 7.0.32 and Laravel 5.5.43
If you want to create defaults symlinks you should create one for yourself.
This is the symlink pattern:
ln -s target source
So in your case you have to do following:
ln -s /home/user/public_html storage/app/public