2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Laravelでシンボリックリンク作成

Posted at

Docker環境のLaravelでシンボリックリンクを作成。

php artisan storage:link

これで public内に storageディレクトリのリンクが貼られる。

   
   
と、思ったらstorage内のファイルが表示されなかった・・・

Docker内に入ってファイルを確認

docker-compose exec app bash
ls -la laravel/public

     

リンクがおかしい
Dockerのルートディレクトリになってない。

lrwxr-xr-x  1 root root   60 Feb 11 16:00 storage -> /Users/(略)/laravel/storage/app/public

     

シンボリックリンクを相対パスに変更

cd laravel/public
unlink storage
ln -s ../storage/app/public storage

なんとか治った。

  
 


参考

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?