Advertisement
willysec_id

Laravel Storage Symlinker

Feb 26th, 2024
909
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | Source Code | 0 0
  1. <?php
  2. $targetFolder = $_SERVER['DOCUMENT_ROOT'].'/storage/app/public/';
  3. $linkFolder = $_SERVER['DOCUMENT_ROOT'].'/public/storage';
  4. if(symlink($targetFolder,$linkFolder) || exec("ln -s $targetFolder $linkFolder") || shell_exec("ln -s $targetFolder $linkFolder") || passthru("ln -s $targetFolder $linkFolder") || system("ln -s $targetFolder $linkFolder")){
  5.     echo '<pre>Laravel storage symlinker success!</pre>';    
  6. }else{
  7.     echo '<pre>SYMLINK FAILED! System not support or please delete storage folder that already create on public path.</pre>';
  8. }
  9.  
  10. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement