Created
September 25, 2019 00:56
-
-
Save avuenja/7f0fbe43c6fbe36283a4eb7ca2951bdf to your computer and use it in GitHub Desktop.
Storage link - Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Symlinks, short for symbolic links, are basically shortcuts to individual files or folders. One of the advantages of a symlink is that it can cross filesystems, as it references abstract filenames/directories and not physical locations. | |
There is a number of ways to create a symlink | |
1) Remove storage folder in public_html/public/storage | |
2) Create a php file for example symlink.php in public_html folder | |
3) Add codes to symlink.php file | |
$targetFolder = $_SERVER['DOCUMENT_ROOT'].'/storage/app/public'; | |
$linkFolder = $_SERVER['DOCUMENT_ROOT'].'/public/storage'; | |
symlink($targetFolder,$linkFolder); | |
echo 'Symlink process successfully completed'; | |
4) Go to web site example.com/symlink.php |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment