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

thusfar's avatar

Creating symbolic link on Homestead?

I'm trying to link storage directories on Homestead, but when I try I get an error:

 failed to create symbolic link public/storage Protocol error

the command was

ln -s /home/vagrant/code/myapp/storage/app/public /home/vagrant/code/myapp/public/storage

Is there any way around it?

0 likes
7 replies
christopher's avatar

Just try it with sudo e.g

sudo ln -s /home/vagrant/code/myapp/storage/app/public /home/vagrant/code/myapp/public/storage
2 likes
thusfar's avatar

Nope. I still get the same error.

thusfar's avatar

Thanks for the links. However, I've tried everything on that second link and I still get the same error.

darwinluague9001's avatar

I'm using windows 10 running the command prompt as administrator fixed the issue.

3 likes
willbrowning's avatar

@darwinluague9001 What did you run in the command prompt? 'php artisan storage:link'?

Are you using homestead?

UPDATE:

Finally got it to work on Windows 10 with homestead by running,

ln -sr storage/app/public public/storage

whilst on local machine in spark root directory (not ssh'd into homestead).

22 likes
ltrtuan's avatar

@tttwb you are correct. Open command line in root project (i use git bash), use exactly your command line, it works

Please or to participate in this conversation.