'403 error in Laravel storage directory only

I'm currently getting a 403 error on the storage directory.
I have tried the correct file path for both a php artisan link and the regular symlink from command line The specific path is this one:

http://example.com/storage/app/public/category/zASySdXhEtXBaeWoz4KLJoIVLVxm3W6jRr6gHQhN.jpg

This is linked to the storage directory: to here: example.com/public/storage/*

I created the symlink like so:

ln -s /var/www/vhosts/example.com/httpdocs/storage /var/www/vhosts/mydomain.com/httpdocs/public

The above directory is for the symlink one but for php artisan link the url is slightly different.

the permissions set for storage before were executed running:

chmod -R 775 storage/

checking permissions I get this:

ls -la ./httpdocs
drwxr--r--   5 pacer psacln          46 Apr  8  2021 storage

Everything else works except the storage directory. I've seen the other questions regarding 403 and have attempted those fixes but nothing is working. Any idea what I'm doing wrong?



Solution 1:[1]

The storage link points directly to the "app/public" folder. So the link address will look like this :

http://example.com/storage/category/zASySdXhEtXBaeWoz4KLJoIVLVxm3W6jRr6gHQhN.jpg

Solution 2:[2]

first : run commint

php artisan storage:link



http://example.com/storage/category/zASySdXhEtXBaeWoz4KLJoIVLVxm3W6jRr6gHQhN.jpg

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 FabricioG
Solution 2 ali hassan