Laravel图像加载在本地主机上但不在服务器上

I have my application setup locally and on an ubuntu server. Locally everything works fine and images are loading just fine but not on the server. The image path is the same but on the server I see the 404 Not Found page when trying to see an image. Could someone point me in the right direction? Do I need to do some configuration on the server to get it to work?

评论
  • 不是本人
    不是本人 回复

    常见问题#1

    Storage::url use APP_URL - config('app.url'). You need to change APP_URL from .env.

    APP_URL=http://yourserver-ip-or-domain.tld
    

    常见问题#2

    The public disk is intended for files that are going to be publicly accessible.

    To create the symbolic link, you may use the storage:link Artisan command:

    php artisan storage:link