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

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

    I had an issue creating a symlink to a folder located under subdomain, tried everything for almost 3 hours, and no luck. My case was as follow:

    1. The uploads folder is located under subdomain: images.example.com.
    2. I upload images using the root document: $_SERVER['DOCUMENT_ROOT'].'/uploads/
    3. I want to create a symlink in that root document.

    Finally, I tried this solution and it works as expected:

    ln -s /home/customer/www/images.example.com/public_html/uploads /home/customer/www/example.com/public_html/uploads

    Note: I used PuTTY to create that symlink

提交回复
热议问题