Back to Error Center
Symlink error for storage
Error Message
The file "/public/storage" does not exist
Cause
The storage symlink hasn't been created or was deleted. The symlink connects public/storage to storage/app/public.
Solution
Run php artisan storage:link to create the symlink. If it fails, create it manually: ln -s ../storage/app/public public/storage
Code Example
Fix
# Create the symlink
php artisan storage:link
# If the command fails, create manually
ln -s ../storage/app/public public/storage
# Verify
ls -la public/storage
# Should show: storage -> ../storage/app/public
Debugging Steps
- Run php artisan storage:link
- Check if public/storage exists
- Verify the symlink target exists
- Check permissions on storage/app/public
Prevention
Always run storage:link during deployment. Include it in deployment scripts. Test file uploads after deployment.