How to make a symlink in a deployed website

Viewed 4057

I am new in Laravel, as you know in order to access stored files you should have a symlink from storage/app/public to public/storage. In computer you can just type in command line: php artisan storage:link. But now I have deployed my website on hosting and want to create a symlink. How can I do it?

4 Answers

Just create a symlink in a php file and upload it to your public folder then navigate to it through your browser. The links must be absolute path....

$targetFolder = '/home/account_name/laravel/storage/app/public';

$linkFolder = '/home/account_name/public_html/storage';

symlink($targetFolder, $linkFolder);

echo 'Done!'

Lets save the file as link.php and upload it then navigate to it via http://your_site.com/link.php

Related