Usually I use chmod -R 755
for the htdocs
folder.
But if I'm executing composer create-project --prefer-dist laravel/laravel applicationname
and call http://localhost/applicationname/public/ I get this error.
UnexpectedValueException
The stream or file "/opt/lampp/htdocs/applicationname/storage/logs/laravel-2019-09-12.log" could not be opened: failed to open stream: Permission denied
I executed chmod -R 755 applicationname
in the htdocs
folder because I thought the newly created folders may have different permissions but I get the same error. I have to use chmod -R 777 applicationname
to make it work. Weirdly when I use chmod -R 755 applicationname
afterwards I don't get the error. I have no idea what's going on.
What permissions should I give to the folder and subfolders to avoid such issues in the future?
The question has been answered for a common webserver but not for XAMPP. If I follow the instructions I get the same problems as I stated above. I have to use chmod -R 777 storage/*
to make it work.