Laravel Sail - Failed to open stream: Permission denied

Lee How MunLee How Mun
1 min read

A fresh Laravel Sail installation is getting the error Failed to open stream: Permission denied whenever when we go to http://localhost or run artisan command such as: sail artisan make:model

Turns out that Sail was running as 'sail' user but my WSL is running as root user:

A quick solution to this is just chown everything in sail container back to 'sail' user:

# Console to sail as root
sail root-shell
# chown everything in /var/www/html back to sail
chown -R sail:sail ./*
0
Subscribe to my newsletter

Read articles from Lee How Mun directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Lee How Mun
Lee How Mun