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

前端 未结 6 642
天涯浪人
天涯浪人 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:29

    assuming that your laravel project "public" directory and "public_html" directory are different. Or your subdomain pointer directory may be different , then use your subdomain pointer directory like "public_html" below given process.

    apply command: $ php artisan storage:link

    this command will create symlink to "public" directory to your laravel project. not inside the "public_html" . so we need to move the "storage" link to "public_html" directory. for this you can move directly. if it doesn't work then move it using command . go inside the "public" directory and run the below command according to your "public_html" directory location.

    $ mv storage /home/yourHostinInfo/domains/domainName/public_html
    

    the path might be different based on your hosting information.

提交回复
热议问题