wodby/docker4php

Some problems upon working with Laravel

roman-yakimkin opened this issue · 5 comments

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.

  1. 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.
  2. 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?

Hi,

  1. what's the location of laravel.log, is it created by Laravel?
  2. run make shell if you have Makefile or docker exec -ti [PHP CONTAINER ID] sh
alsar commented

@roman-yakimkin you should set the PHP_FPM_USER and PHP_FPM_GROUPenvironment variables for the php container to wodby so that FPM has write access.

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?

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.