Some problems upon working with Laravel
roman-yakimkin opened this issue · 5 comments
roman-yakimkin commented
Hello.
I'm a novice in docker.
I need to work with Laravel using docker-compose and I decided to use this solution. I managed to set up containers and install Laravel.
But I encountered some problems.
- An error. "The stream or file "laravel.log" could not be opened: failed to open stream: Permission denied". I don't know how to solve it correctly without forcibly setting rights as 777.
- Could you clarify me, how can I get into the running container via my terminal? I mean I need to type "php -v" or "php artisan" in my terminal and it should work correctly. How can I do it?
csandanov commented
Hi,
- what's the location of
laravel.log
, is it created by Laravel? - run
make shell
if you have Makefile ordocker exec -ti [PHP CONTAINER ID] sh
alsar commented
@roman-yakimkin you should set the PHP_FPM_USER
and PHP_FPM_GROUP
environment variables for the php
container to wodby
so that FPM has write access.
csandanov commented
yes, that's one of the options, less secure but totally fine for the local development
alsar commented
What do you propose for the production environment?
csandanov commented
Have this file owned by www-data
so FPM could write to it or owned by wodby
and have www-data
group with group writing permissions.