Question

Symbolic link not allowed or link target not accessible in laravel (Plesk in ubuntu 18)

Posted March 7, 2021 1.5k views
Ubuntu 18.04Laravel

Hi all,

I am tryign to host my app in ubuntu server with Plesk. I also have ran php artisan storage:link command for create Symbolic for my storage folder in laravel. But I cannot access my images that I have uploaded to my storage folder Symbolic to public/storage folder. Its says 403 error. Then I check my server error log. It has below warning.


Symbolic link not allowed or link target not accessible

Anyone can help me on this?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

Hi @edexercom,

The Symbolic Link needs to be owned by the same user and group that’s owning the Website Folder otherwise you won’t be able to access it.

To give you the proper answer, I’ll recommend providing a little bit more information such as the permissions and ownerships of the folders that lead to the symbolic link. It’s 99% a permissions/ownership issue!

Regards,
KFSys

Hi @KFSys

Here is the permission view Click Here

  • Hi @edexercom,

    Try giving the public folder and the one before that - public_html I would assume all the permissions. Just for a test and tell me how it goes.

    • The above solution also not work. Can you help me with this?

      Here is permisions

      drwxr-x— 12 edexer psaserv 4096 Mar 14 20:45 ./
      drwx–x— 5 edexer psaserv 4096 Mar 14 20:35 ../
      -rw-r–r– 1 edexer psacln 1127 Mar 14 20:45 .env
      -rw-r–r– 1 edexer psacln 1284 Feb 16 08:29 .env.example
      -rw-r–r– 1 edexer psacln 116 Feb 16 08:29 .gitattributes
      -rw-r–r– 1 edexer psacln 142 Feb 16 08:29 .gitignore
      -rw-r–r– 1 root root 498 Mar 14 20:35 .htaccess
      drwxr-xr-x 9 edexer psacln 4096 Mar 14 20:36 app/
      -rw-r–r– 1 edexer psacln 1697 Feb 16 08:29 artisan
      drwxr-xr-x 3 edexer psacln 4096 Mar 14 20:36 bootstrap/
      -rw-r–r– 1 edexer psacln 1913 Mar 14 15:13 composer.json
      -rw-r–r– 1 edexer psacln 295014 Mar 8 10:44 composer.lock
      drwxr-xr-x 2 edexer psacln 4096 Mar 14 20:36 config/
      drwxr-xr-x 5 edexer psacln 4096 Mar 14 20:36 database/
      -rw-r–r– 1 edexer psacln 464 Mar 14 19:22 index.html
      -rw-r–r– 1 edexer psacln 469244 Feb 16 08:29 package-lock.json
      -rw-r–r– 1 edexer psacln 1300 Feb 16 08:29 package.json
      -rw-r–r– 1 edexer psacln 1187 Feb 16 08:29 phpunit.xml
      drwxr-xr-x 11 edexer psacln 4096 Mar 14 20:39 public/
      -rw-r–r– 1 edexer psacln 2 Feb 16 08:29 readme.md
      drwxr-xr-x 5 edexer psacln 4096 Mar 14 20:36 resources/
      drwxr-xr-x 2 edexer psacln 4096 Mar 14 20:36 routes/
      -rw-r–r– 1 edexer psacln 584 Feb 16 08:29 server.php
      drwxr-xr-x 6 edexer psacln 4096 Mar 14 20:36 storage/
      -rw-r–r– 1 edexer psacln 3163 Feb 16 08:29 test.blade.php
      drwxr-xr-x 4 edexer psacln 4096 Mar 14 20:36 tests/
      -rw-r–r– 1 root root 68861712 Mar 14 20:25 v.1.beta.zip
      drwxr-xr-x 51 edexer psacln 4096 Mar 14 20:36 vendor/
      -rw-r–r– 1 edexer psacln 566 Feb 16 08:29 webpack.mix.js

      • Hi @edexercom,

        Let’s review the problem from a bit further back.

        When we have permission issues it’s because the user that needs to be executing something does not have them. In this case there are a couple of possibilities.

        • The user/group does not have permissions.
        • The user does not have group permissions.
        • Ownership is not correct.

        I can see you have edexer as user and psacln as group. The easiest way is to use su and switch with the user edexer.

        su edexer
        

        Try to browse around directories, see if you have any issues with that.

        Regards,
        KFSys