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

  1. Run php artisan storage:link
  2. Check if public/storage exists
  3. Verify the symlink target exists
  4. Check permissions on storage/app/public

Prevention

Always run storage:link during deployment. Include it in deployment scripts. Test file uploads after deployment.