How to create a symbolic link for laravel website in cPanel

How to create a symbolic link for laravel website in cPanel



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

For details :

29 thoughts on “How to create a symbolic link for laravel website in cPanel

  1. symlink success but the image still can't appear, just success upload to storage/app/public. But can't upload to public_html/storage. please help

  2. If somebody is having trouble with the symlink.php file, just paste the symlink code into the index.php file and run it once. It worked for me.

  3. Please note that most of the errors people are reporting is due to different directory structure. In this tutorial the whole project seems to reside in the server's 'public_html' directory so if you've modified your layout like me (mine public => public_html and the rests of the files are in a custom folder in my server root directory.) I was experiencing issues too apparently CRON couldn't go back and get the /storage/app/public/ directory had to place the symlink.php file in my account home directory too(where public_html and public_ftp are) and then use a CRON job to execute that file since its not accessible via web browser

  4. i am trying to install it at subdomain and I copy and paste code but problem did not resolve , would you please help

  5. oh! thank you, sir! It really worked as magic and it is so easy. But laravel project .htaccess file has not allowed direct access for this file. I had to create blade templating file for this eg. symlink.blade.php in view folder then register in web.php. I hope this will help other developer

  6. please help me, i've this result when i access myweb.com, the result is :

    Warning: symlink(): No such file or directory in /home/tuitscot/public_html/symlink.php on line 4

    success

  7. i want to create a symbolic folder in my sub domain specific folder how can i do that i have created as like my sub domain url ==> admin.mydomain.com/my_project_name
    and i have created the code as like
    <?php
    $targetFolder = $_SERVER['DOCUMENT_ROOT'].'my_project_name/storage/app/public';
    $linkFolder = $_SERVER['DOCUMENT_ROOT'].'my_project_name/public/storage';
    symlink($targetFolder,$linkFolder);
    echo 'Symlink process successfully completed';
    ?>
    this code stay on the url => admin.mydomain.com,
    and i have run the code from the url => admin.mydomain.com
    i also want to create the symbolic storage folder within => admin.mydomain.com/my_project_name
    how can i do that please help me

Leave a Reply

Your email address will not be published. Required fields are marked *