Try doing a Linux symbolic link: using ln.
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:
- Deleting and creating symlink again and again using
php artisan storage:linkcommand. - Creating symlink using linux command
ln -s ../storage/app/public storageinside public folder. - Running
Artisan::call('storage:link')using a web route entry. - 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?
Please or to participate in this conversation.