Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

galaners's avatar

Access Storage Path Without Symlink

According to my hosting service provider, I can't make a symlink between domines in a shared hosting because that's a mayor security issue (this happened when I ask them why my symlink created with "php artisan storage:link" wasn't working). So, I'm looking for another alternative if there is so I can't make my Laravel app works on their servers (the company I work for contracted the service with them without asking my opinion, so I don't have another alternative).

My project is located in "repositories/Laravel-app" in my user root folder, while the public folder content is located in "public_html (or www/html)" in my user root folder.

Any help will be welcome.

0 likes
4 replies
MohamedTammam's avatar

Mostly the command didn't work because different structure than the default. If you can SSH to the host, try to run the command your self you should add public_html/storage symlink to your_project/storage/app/public directory

ln -s <path to the file/folder to be linked> <the path of the link to be created>
galaners's avatar

@MohamedTammam I don't have access through SSH. What I did to create the symbolic link was to make a path that would execute the command "php storage:link". The link is created, but it does not work throwing the following error:

Symbolic link not allowed or link target not accessible: /home/myuser/public_html/storage, referer: http://myroute/

I tried to change the permissions according to some website, but it didn't work either.

jlrdw's avatar

If they are not private images that anybody can see then just serve them from public. Just skip the usage of symbolic link.

galaners's avatar

@jlrdw There are. The requirements are that the app must work that way, so I don't know how to proceed here. Thanks for the answer.

Please or to participate in this conversation.