sorry for my bad english.
Please help. I get into trouble while hosting my project. There are problems with symlinks and storage. Files or images stored on storage can not be read, even though the url gets the time to upload the file. What can i do to justify this problem?
symlink error and cannot display image


directory structure like this



the same problem. does anyone know how to fix it?
Mostly problem happen on Window environment. Hmmm ...
no, its on server. I have this problem only on server
Is there any other way if symlinks can not be used? Such as changing the directory to upload the file or its image?
i try this and work like champ.. change the root
'public' => [
'driver' => 'local',
'root' => public_path('storage'),
'visibility' => 'public',
],
Hello Everyone I have this issue and solve it this way.
On linux/debian :
1- go the public folder and remove storage folder
2- re-create the symlink : php artisan storage:link
On windows :
1- install git for widows and with git-bach
2- go the public folder and remove storage folder
3- re-create the symlink : php artisan storage:link
And it solve all problem
Alternatively for windows , you can just remove the storage folder and use windows commande to recreate the symbolic link. exemple ( Mklink /d ...path\public\storage\ ...path\storage\app\public\ ).
But i never try this out.
god bless you all.
@ferywijaya what file is that ?
oh yeah, figured it out..
config/filesystems.php
I had the same problem. Thanks to @ferywijaya and @radiumrasheed for the solution
Just change in config/filesystems.php
'root' => storage_path('app/public'),
to,
'root' => public_path('storage'),
Most helpful comment
Hello Everyone I have this issue and solve it this way.
On linux/debian :
1- go the public folder and remove storage folder
2- re-create the symlink : php artisan storage:link
On windows :
1- install git for widows and with git-bach
2- go the public folder and remove storage folder
3- re-create the symlink : php artisan storage:link
And it solve all problem
Alternatively for windows , you can just remove the storage folder and use windows commande to recreate the symbolic link. exemple ( Mklink /d ...path\public\storage\ ...path\storage\app\public\ ).
But i never try this out.
god bless you all.