'error `Missing storage symlink` for voyager admin panel in cPanel
I have uploaded a voyager admin panel in my cPanel.
It gives error Missing storage symlinkand images are not shown of new added item.
Suppose I want to add a new user. All information is shown of new user accept user avatar.
In locally error is easily fixed by running the cmd php artisan storage:link.
But in live server how to fixed this error ?
I have already change the path of storage driver in config/filesystems.php. Change the path from storage_path() to public_path()
'public' => [
'driver' => 'local',
'root' => public_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
Solution 1:[1]
FIXED !!
Delete public/storage folder and run the command in cmd
php artisan storage:link
Solution 2:[2]
It is a path related problem. I have changed the App_url in my .env file. Now it's successfully showing the image.
Solution 3:[3]
I had the same issue. It happened because the file structure or something changed from the original Laravel setup. For me, I switched from using Artisan to vagrant.
I resolved by logging into vagrant and removing the original symlink:
rm -rf /home/vagrant/code/public/storage
I went ahead and created the new symlink but you should now be able to click the Fix link in Voyager admin to create the new one.
ln -s /home/vagrant/code/storage/app/public /home/vagrant/code/public/storage
Solution 4:[4]
You need to change the storage path into de filesystems.php file
to:
'public' => [
'driver' => 'local',
'root' => storage_path('./../../public_html/storage'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
Solution 5:[5]
this works for me !
cd public_html
ln -sr ../storage/app/public storage
Solution 6:[6]
I've fixed this by deleting the public/storage link and folder and then create again the folder and then:
php artisan storage:link
EDIT:
I also had to set this configuration in the filesystems.php
'public' => [
'driver' => 'local',
'root' => public_path('storage'),
'url' => env('APP_URL').'storage',
'visibility' => 'public',
],
Solution 7:[7]
I've fixed this by most easy way:
remove storage folder from public directory, then hit fix button from admin area
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Arafat Rahman |
| Solution 2 | raff |
| Solution 3 | Ivan DaGreat |
| Solution 4 | luislalohdz |
| Solution 5 | Lassad Kefi |
| Solution 6 | |
| Solution 7 | Ishwar Bhusal |
