-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Unable to install plugins when using bind or volumes rw docker #415
Comments
Duplicate of #298 (comment) and #397 (comment) If you're adding Adding and activating a few plugins: Checking the mounted folder on the host: $ ls
db_data/ docker-compose.yml wp/
$ ls -l wp/wp-content/plugins/
total 16
drwxr-xr-x 4 www-data www-data 4096 Jun 18 10:51 akismet/
drwxrwxr-x 6 www-data www-data 4096 Jul 17 13:44 gutenberg/
-rw-r--r-- 1 www-data www-data 2578 Mar 18 10:19 hello.php
-rw-r--r-- 1 www-data www-data 28 Jun 5 2014 index.php |
Thanks for validating that it worked. After seeing that you were able to make it work I keep messing with it and what it appears to be is an issue with NFS. The ./wp directory in my case resides on /mnt/Docker_Share/Wordpress/wp . /mnt/Docker_Share is mounted via nfs using /etc/fstab with your typical mount options nothing special. For testing I did the following. Then ran though the installer quickly, and installed a plugin which worked. Is there a way to test and understand why NFS is causing an issue here? I have a slew of other containers with mounted volumes on the same mount without a problem. |
How are your NFS permissions set? #389 (comment) |
@majerus1223 Bind mounted volumes will make the whole directory tree on the container inherit the file permissions of the host filesystem. So you need to ensure that Apache is running with a user ID that permissions to write to those files. Use the wordpress:
depends_on:
- db
image: wordpress:latest
ports:
- "8000:80"
restart: always
volumes:
- ./wp:/var/www/html
environment:
APACHE_RUN_USER: "#33"
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: wordpress
WORDPRESS_DB_NAME: wordpress Note that the leading hash before |
When using docker compose as shown below with bind volumes you cannot install plugins without modifying wp-config.php and setting define( 'FS_METHOD', 'direct' ); . Even when you create the directories manually, chown -R 33:33 then chmod 644 -R you cannot install plugins as you encounter an error. This seems to lead to inconstancy where if you use the FS_Method, direct some plugins misbehave. Where is the code that is doing the permissions checking on the /var/www/html and causing Wordpress to act this way?
Thanks!
The text was updated successfully, but these errors were encountered: