Storage in laravel says symlink - no such file

后端 未结 12 1959
离开以前
离开以前 2020-12-07 22:39

I deployed laravel app on shared hosting in public_html/app folder. Here is everything from public folder. In /../../files I have rest of files. When I do php artisan storag

12条回答
  •  遥遥无期
    2020-12-07 23:37

    This usually happens after moving Laravel app to another directory

    The actual storage directory is "/AppName/storage/app/public/"

    Laravel creates a symbolic link pointing to actual storage dir "/AppName/public/storage"

    Other meaning

    "/AppName/public/storage" points to => "/AppName/storage/app/public/"

    On changing root app directory to "/AnotherAppName/" symlink will still point to the old path

    "/AnotherAppName/public/storage" => "/AppName/storage/app/public/"

    my solution is to manually update the symlink using

    ln -sfn /AnotherAppName/storage/app/public/ /AnotherAppName/public/storage
    

提交回复
热议问题