How to create laravel storage symbolic link for production or sub domain system?

前端 未结 6 730
天涯浪人
天涯浪人 2021-02-04 02:41

When I worked on laravel local development server php artisan storage:link works fine for me. But when I transfer my site to production server then I saw my public

6条回答
  •  醉酒成梦
    2021-02-04 03:26

    Creating symbolic link in a web server using SSH

    In Laravel documentation, a symbolic link (symlink or soft link) from public/storage to storage/app/public should be created to make files accessible from the web.

    (THIS PROCEDURE WILL CREATE SYMBOLIC LINK WITHIN THE LARAVEL PROJECT DIRECTORY)

    Here are the steps on how you can create symbolic link in your Linux web server using SSH client:

    1. Connect and login to your web server using SSH client (e.g. PUTTY).

    2. Link storage/app/public to public/storage using the syntax.

    ln -s target_path link_path
    

    Example (in CPanel File Directory)

    ln -s /home/cpanel_username/project_name/storage/app/public /home/cpanel_sername/project_name/public/storage
    

提交回复
热议问题