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

bathishig's avatar

Storage issue when push

When I push any code to my production its removes php artisan storage:link command and after push some changes I need delete public/storage folder and re-run php aritsan storage:link again why it's happening?

0 likes
4 replies
ahmeddabak's avatar

The storage file in the public folder is only a symbolic link (A virtual folder), when you try to access it, it will redirect you to the original folder storage/app/public.

What the virtual folder stores is the path to the original folder, so on maybe /users/pc1/projects1/storage/app/public, but when you push to server the link to the original folder will be changed for ex. /var/www/example.com/storage/app/public therefore the virtual folder will not be able to find the original folder and will stop working.

ahmeddabak's avatar
Level 47

Delete the storage folder and run php artisan storage:link like you said. you just have to do it the first time you upload the project to a new server

bathishig's avatar

Okey got it. I was confusing why its happening.

Please or to participate in this conversation.