Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeremy447 opened this issue Oct 16, 2020 · 11 comments
Assignees

Comments

@jeremy447
Copy link

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
@MrOffline77
Copy link
Collaborator

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

@jeremy447
Copy link
Author

jeremy447 commented Oct 21, 2020

#67 could solve your issue.

Perhaps but it seem to cause problems #67 (comment)

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
Copy link
Author

Are you using WSL ?

No I'm on Ubuntu

@ohthehugemanatee
Copy link

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.

@Blaik59
Copy link

Blaik59 commented Jan 8, 2021

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

@elhenro
Copy link

elhenro commented Feb 4, 2021

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

@elhenro
Copy link

elhenro commented Feb 4, 2021

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

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

@gdsoftdev
Copy link

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

worked for me

@rcdeo
Copy link
Contributor

rcdeo commented Aug 15, 2023

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

@artemsites
Copy link

artemsites commented Jan 20, 2024

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?

@flth
Copy link

flth commented Feb 22, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants