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

iamsubingyawali's avatar

Storage symlink doesn't work with Laravel and Vue in Namecheap CPanel (LiteSpeed)

I am trying to access my image files stored inside storage/app/public/subfolder/ using symlink inside /public folder in my Laravel app. Everything works fine in my local setup and also in Jelastic Apache deployment, but it doesn't seem to work in CPanel with LiteSpeed. I am trying to access the files using the link /storage/subfolder/image.png but it is not accessible on CPanel deployment.

I tried creating and deleting storage symlink hundreds of times, but it didn't work. Below are few things I tried:

  1. Deleting and creating symlink again and again using php artisan storage:link command.
  2. Creating symlink using linux command ln -s ../storage/app/public storage inside public folder.
  3. Running Artisan::call('storage:link') using a web route entry.
  4. Redeploying and reconfiguring the app several times and creating storage symlink.

In all of these failed attempts I can verify that storage symlink is created every time inside public folder. I can navigate and view files from public/storage/ folder using CPanel terminal without any issues but can't access them in the deployed app.

I have exact same configuration in Jelastic Apache deployment and in my local deployment and there it is working without any issues.

UPDATE:

Additionally, I tried creating a storage directly manually inside public folder with the same structure and it worked. But symlink doesn't work.

This is becoming very weird. I am not being able to think of any possible mistakes. What might have happened?

0 likes
2 replies
jlrdw's avatar

Try doing a Linux symbolic link: using ln.

Please or to participate in this conversation.