thedevdojo / voyager

Voyager - The Missing Laravel Admin
https://voyager.devdojo.com
MIT License
11.78k stars 2.67k forks source link

Missing storage symlink #5081

Closed Dhaoui0Chaher closed 3 years ago

Dhaoui0Chaher commented 4 years ago

Version information

when i host my laravel project i get an error message with voyager ( it was work correctly in local). the error : " Missing storage symlink We could not find a storage symlink. This could cause problems with loading media files from the browser. " so Pictures are not showing. i change the APP_URL in the .env file and The pictures are now showing( the error message stilll showing), but when i add a new picture or change an old picture, it disappear again and i don't find it in the storage folder too.

so what i did to host the project i create a folder caller "myapp" and i put in it all the file but the public files i put them out. and i change the index.php file like that

require __DIR__.'/myapp/vendor/autoload.php';
$app = require_once __DIR__.'/myapp/bootstrap/app.php';

error

Steps To Reproduce

  1. Click on 'Fix it'
  2. See the error " symlink(): No such file or directory " ( you can check it here )

the error

https://flareapp.io/share/o7AJQJ5p#F62

Additional context

that's what i have in the config/filesystems.php

'public' => [
            'driver' => 'local',
            'root' => storage_path('/app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

Need to know

when i create a folder with the name "public" and i put in it the "storage" folder and i put this public folder in "myapp" folder the error message disappears but the pictures are not showing.

fletch3555 commented 4 years ago

The issue is likely with your deployment process and hosting setup. Please see here https://stackoverflow.com/questions/29892024/laravel-5-on-shared-hosting-wrong-public-path for examples. Sounds like you've discovered one of them already.

In short, this has nothing to do with Voyager. Voyager just uses one of the laravel features that is affected by your laravel setup.

To answer your "need to know" at the bottom, you're likely not actually using the symlink, and instead using a directory that differs from the one Voyager is writing to.

Dhaoui0Chaher commented 4 years ago

i fix that i host the website correctly and when i click on " fix it" the storage folder created in the public folder everything going right but images not showing why?

fletch3555 commented 4 years ago

Still a number of possible causes, which we can't really narrow down for you since we have no idea how you've setup your server/laravel/voyager.

The most common causes are:

  1. Missing/improperly configured symlink
  2. Misconfigured APP_URL
  3. Misconfigured webserver (apache/nginx/etc)

For the first one, it's worth noting that symlink != folder. Think of it like a shortcut. It doesn't actually hold anything itself, but provides a view into the actual directory it points to. Easiest check for that is whether public/storage and storage/app/public show the exact same contents. If not, your symlink is actually a directory and therefore not setup properly

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have further questions please ask in our Slack group.