How to create laravel storage symbolic link for pr

2019-06-19 14:48发布

When I worked on laravel local development server php artisan storage:link works fine for me. But when I transfer my site to production server then I saw my public storage link was a folder. Then I delete that tried to create a link. I got an error because my app was in the root folder and tried to solve this problem.

2条回答
做个烂人
2楼-- · 2019-06-19 15:36

I solved this problem by another command for creating a symbolic link:

ln -s /path/to/laravel/storage/app/public /path/to/public/storage
查看更多
Rolldiameter
3楼-- · 2019-06-19 15:45

Another simple way is to run Executing php artisan storage:link Command Programmatically

On routes/web.php

Route::get('/foo', function () {
Artisan::call('storage:link');
});
查看更多
登录 后发表回答