Type the command yourself with the good path.
http://man7.org/linux/man-pages/man1/ln.1.html
Or you can write in a php file and execute this file.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi,
I'm working on an application and wanted to implement image uploading to my application. Now when i want to create the symbolic link for my files, i get the following error:
ErrorException : symlink(): No such file or directory
Exception trace:
symlink("/home/user/private/application/storage/app/public", "/home/user/private/application/public/storage")
Now i know what the cause of this is, but i don't know how to fix and/or have a workaround for it.
I only have my public folder in my html_root directory, and have the rest of the application in a directory outside of my html_root. In this case /home/user/private/application.
when i use php artisan storage:link it tries to find the public folder in my 'private' directory, but can't find it because my public folder is in html_root.
I've browsed through stackoverflow and laracast already, but haven't found a similar issue yet.
Does anybody have a solution for this problem?
Kind Regards,
@salmon and @rivory_g performing the ln command for the storage did not solve my problem.
It did create the symlink for the storage folder but seemed to have broken the upload functionality of Laravel.
Instead i went back to Laravel's official directory structure and placed my contents from html_root back to my private directory inside the public folder. I then created a symlink of the public folder and renamed it to html_root.
This way i can use everything without having to tweak or use custom commands.
Solution: Create a symlink of the public folder to your /home/user and remove your html_root folder or rename it.
ln -s /home/user/private/application/public /home/user
Inside your /home/user folder you now have a symlink named public. Rename this folder to html_root and it should make the website function normally.
Please or to participate in this conversation.