How to create symbolic link for laravel website in cpanel, that is Laravel Storage Symlink.
There is an simple way to do so, by creating a file and running it. Just follow these steps.
- Make sure you do not have a storage folder create in the public folder. (public_html/public/storage). If so then remove it.
- Create a PHP file name symlink.php in the root folder, which is in the public_html folder.
- And now paste this code.
$targetFolder = $_SERVER['DOCUMENT_ROOT'].'/storage/app/public'; $linkFolder = $_SERVER['DOCUMENT_ROOT'].'/public/storage'; symlink($targetFolder,$linkFolder); echo 'Symlink process successfully completed';
Now open the file you have just created. The URL would be something like this website.com/symlink.php and this is done. Now you can see the public folder has a storage folder created.