Create Laravel storage symlinks for production or subdomain systems: a step-by-step guide
P粉493313067
P粉493313067 2023-08-27 18:54:31
0
2
366
<p>When I'm working on the Laravel local development server <code, php="" artisan="" storage:link<="" code=""> works fine for me. However, when I move the site to the production server, I see that my public storage link is a folder. Then I removed the content that was trying to create the link. I'm getting the error because my app is in the root folder and trying to fix this. </code></p>
P粉493313067
P粉493313067

reply all(2)
P粉759457420

Another easy way is to programmatically run the php artisan storage:link command

On routes/web.php

Route::get('/foo', function () {
Artisan::call('storage:link');
});
P粉133321839

I solved this problem with another command that creates a symlink via terminal/cmd/shh:

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

I also solved this problem, using laravel web routing routes/web.php

Route::get('/foo', function () {
    Artisan::call('storage:link');
});
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!