首页 文章

Laravel Voyager存储链接问题

提问于
浏览
0

我使用自定义目录结构在xampp上安装laravel . 公用文件夹的内容位于 htdocs/demos/sricargo/ 文件夹中

enter image description here

其余的文件和文件夹与htdocs和此文件夹位于同一级别

enter image description here

我设法让laravel使用这个文件夹结构 . 但是在我安装了voyager后,在航海家仪表板中它给了我这个错误

缺少存储符号链接我们找不到存储符号链接 . 这可能会导致从浏览器加载媒体文件时出现问题 .

当我按下修复按钮时,它会出现此错误

无法创建缺少的存储符号链接我们无法为您的应用程序生成缺少的符号链接 . 您的托管服务提供商似乎不支持它 .

这是位于 htdocs/demos/sricargo/ 文件夹中的 .htaccess 文件

<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>

我甚至尝试使用 php artisan storage:link 命令创建符号链接,但它会出现此错误

文件名,目录名或卷标语法不正确 . [public / storage]目录已链接 .

当我在媒体页面中创建新文件夹并上传新图像文件时,它实际上已在此位置上传 sricargo_files\storage\app\public\

因此,图像缩略图不会显示在媒体页面中,当我单击媒体页面中的 public url 链接时,它会给出此网址 http://localhost/demos/sricargo/storage/app/public/bb/0U1TwmFxLcJ833ufKOSV4nrJlZs9QvZVb7yjEwq7.jpeg ('bb'是通过媒体页面新创建的文件夹) . 即使此路径上不存在此存储文件夹 htdocs/demos/sricargo/

怎么解决这个问题?有任何想法吗 ?

1 回答

  • 0

    您确实可以设置自定义目录,但自定义目录的位置应该位于您的应用程序目录中以进行本地开发 . 如果您对目录结构进行了更改,则php artisan命令将不起作用

相关问题