How to Create Symlink in Shared Hosting for Laravel

  1. Create a file called symlinkcreate.php in the public_html
  2. Add following code to this file
    
    <?php
    $original = '';
    $copy = '';
    symlink($original, $copy);
    echo 'done';
    ?>
    
    
  3. Original is the the path of the original folder which you want to create symlink from.
    Example:
    '/home/serverName/domains/domainName/laravel/storage/app/public'
  4. Target is the the path to the folder where you need the symlink created to.
    Example:
    '/home/serverName/domains/domainName/public_html/storage'
  5. Open a new tab in your browser. Type in your www.domainName.com/symlinkcreate.php. Hit Enter.
  6. If the screen says 'done'. The symlink is successfully created. Else the screen will show error.