docker-compose-lamp icon indicating copy to clipboard operation
docker-compose-lamp copied to clipboard

[BUG] You need to grant write permissions for PHP on the following directory: /var/www/html

Open jeremy447 opened this issue 4 years ago • 11 comments

Describe the bug You need to grant write permissions for PHP on the following directory: /var/www/html

which Branch / PHP Version are you using ? php71

To Reproduce Steps to reproduce the behavior: Install Prestashop 1.7

Expected behavior Prestashop should be installed

Desktop (please complete the following information):

  • OS: Ubuntu 20.04
  • Chrome
  • Docker Version:
docker -v
Docker version 19.03.13, build 4484c46d9d

jeremy447 avatar Oct 16 '20 15:10 jeremy447

Are you using WSL ? #67 could solve your issue.

MrOffline77 avatar Oct 19 '20 10:10 MrOffline77

#67 could solve your issue.

Perhaps but it seem to cause problems https://github.com/sprintcube/docker-compose-lamp/issues/67#issuecomment-698116189

I'm still experimenting with docker and I have modified your setup to potentially fix this issue and to have the docker config in a .docker folder (with development files in the parent directory). Since I'm still experimenting I'm not sure if it's ok but it seem to work. https://github.com/Paviluf/docker-lamp

jeremy447 avatar Oct 21 '20 18:10 jeremy447

Are you using WSL ?

No I'm on Ubuntu

jeremy447 avatar Oct 21 '20 18:10 jeremy447

I also found that adding a user directive in docker-compose doesn't affect which user owns the apache2 process. The only way to grant access to files is to chown 33:33 on the host system. :(

Running Manjaro.

ohthehugemanatee avatar Dec 21 '20 22:12 ohthehugemanatee

Add in your php Dockerfile RUN usermod -u 1000 www-data

Blaik59 avatar Jan 08 '21 16:01 Blaik59

I have the same problem and adding RUN usermod -u 1000 www-data did not help

elhenro avatar Feb 04 '21 21:02 elhenro

Are you using WSL ? #67 could solve your issue.

setting ..:rw in docker-compose.yml fixed my permission problem

elhenro avatar Feb 04 '21 21:02 elhenro

Add in your php Dockerfile RUN usermod -u 1000 www-data

worked for me

gdsoftdev avatar Apr 07 '21 13:04 gdsoftdev

This post is about this permissions issue. https://aschmelyun.com/blog/fixing-permissions-issues-with-docker-compose-and-php/

rcdeo avatar Aug 15 '23 13:08 rcdeo

Add in your php Dockerfile RUN usermod -u 1000 www-data

and where should I write this? bin/php81/Dockerfile on which line? and then rebuild the image?

artemsites avatar Jan 20 '24 09:01 artemsites

anyone figured this? I am stuck with the same issue, all files created inside docker are listed as root on the host. Added the run command, compose up, nothing. Also tried to exchange www-data with root

flth avatar Feb 22 '24 12:02 flth