How to create laravel storage symbolic link for production or sub domain system?

亡梦爱人 提交于 2019-12-06 19:36:41

问题


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.


回答1:


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');
});



回答2:


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

ln -s /path/to/laravel/storage/app/public /path/to/public/storage


来源:https://stackoverflow.com/questions/45825889/how-to-create-laravel-storage-symbolic-link-for-production-or-sub-domain-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!