简体   繁体   中英

Laravel Voyager Storage link issue

I have used custom directory structure to install laravel on xampp. public folder's content is in the htdocs/demos/sricargo/ folder

在此处输入图片说明

And rest of the files and folders are in same level of the htdocs and in this folder

在此处输入图片说明

I have managed to get laravel working with this folder structure. But after I installed voyager, In voyager dashboard it gives me this error

Missing storage symlink We could not find a storage symlink. This could cause problems with loading media files from the browser.

When I press the fix button it then gives this error

Could not create missing storage symlink We failed to generate the missing symlink for your application. It seems like your hosting provider does not support it.

This is the .htaccess file located in the htdocs/demos/sricargo/ folder

<IfModule mod_rewrite.c>
 <IfModule mod_negotiation.c>
    Options -MultiViews
  </IfModule>

  <IfModule mod_rewrite.c>
    RewriteEngine On
    Options +FollowSymLinks

    RedirectMatch ^/$ /wp-blog/
    Redirect "/demos/sricargo/blog" /wp-blog/

    RewriteBase /demos/sricargo/

    # Redirect Trailing Slashes...
    RewriteRule ^(.*)/$ /$1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ /demos/sricargo/index.php [L]
</IfModule>

I even tried to created the symlink with php artisan storage:link command but it gives this error

The filename, directory name, or volume label syntax is incorrect. The [public/storage] directory has been linked.

When I create a new folder in media page and uploaded a new image file it's actually uploaded in this location sricargo_files\\storage\\app\\public\\

So the images thumbnail are not displaying in the media page and when i click public url link in media page it gives this url http://localhost/demos/sricargo/storage/app/public/bb/0U1TwmFxLcJ833ufKOSV4nrJlZs9QvZVb7yjEwq7.jpeg ('bb' is the newly created folder through media page). Even though this storage folder doesn't exist on this path htdocs/demos/sricargo/

How can this be resolved ? Any ideas ?

you can set custom directory indeed, but the custom directory's location should be in your app directory for local development. If you make changes to your directory structure, php artisan command will not work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM