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

distal-shores's avatar

Symlink problem on production

My app's symbolic links between storage/app/public and public/storage have been created as per usual using php artisan storage:link, however, on production they're not working as intended.

Any uploaded file, for example, saved to /storage/app/public/uploads 404s in the browser on production at the address BASE_URL/uploads/FILENAME, whereas locally (running Valet) this works fine.

Again, adding /storage/ to the endpoint resolves the file as intended. What am I doing wrong here?

0 likes
5 replies
bobbybouwmann's avatar

Well, it creates a symlink from public/storage to storage/app/public, so you always need the storage prefix if you try to access the file directly using the path.

If you want a different path, you need to create a different symlink.

You can find all of this in the documentation: https://laravel.com/docs/7.x/filesystem#the-public-disk

1 like
distal-shores's avatar
distal-shores
OP
Best Answer
Level 2

I've resolved my issue, sorry for the confusion. By setting the root storage path to app/public for both the local and public disks, the environments are now mirroring each other's behaviour. Yes, of course it makes sense that the storage/ prefix should exist on all public files, my bad!

1 like
bobbybouwmann's avatar

@distal-shores Awesome! Can you mark mine or your own answers as a best reply so it's marked as solved? Might be useful for another person ;)

1 like

Please or to participate in this conversation.