-
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
WordPress asking for FTP credentials to install plugins #298
Comments
Do you have appropriate permissions on the
(I'm not able to reproduce the issue -- if I setup a new instance with a bind-mounted volume, I'm able to install plugins directly.) |
This is an "issue" of WordPress well know. |
Issue seems resolved so going to close |
If anyone else is facing this issue, this is how I fixed it on ubuntu: sudo chown -R www-data:www-data path/to/wp-content Leaving it here for those who come from search engines. |
Following up on @awps: you can chown your wp-content/.git/ directory (if you have one) to your local user after you chown everything to www-data. |
@wglambert it's not solved at all at least not as default... the docker image insists on asking for the credentials... This should be covered somehow else in the default docker installation once its a basic feature for anyone trying to develop something with wordpress |
As I noted over at #340 (comment), if you're getting prompted for FTP credentials, it's because of your filesystem permissions. I think you'll find that if you correct the filesystem permissions, the prompt will go away and installations will complete successfully automatically within the Web UI (since the |
Despite having the correct permissions for
|
Guys I have tried eveything you have listed above in linux, nothing seems to work at all. Here is my docker-compose.yml
I have tried changing permissions inside the container to
In this case it says
The plugins folder has exactly same permissions. It just refused to work no matter what I do. So frustrating. |
After playing around a bit. It looks like on initial build the Same thing happens with you theme folder so if you have to generate anything inside of it it has to be owned Even if you local permissions have |
I think the issue should be reopened as it doesn't have a viable solution. Otherwise, I don't see the reason of having this image, you pretty much have to build your own in order to properly develop themes. |
ok the problem seems to be in two places:
Looks like the only solution is to build your own image and make your containers |
Just encountered this problem myself; I found mounting the entire content directory seemed to solve the problem: |
This worked for me! Cheers |
@asolopovas the solution can be the other way around, do Since I'm using docker-compose, I like to use a container to do this:
Kind of extra and runs every restart, but at least I don't have to configure every WordPress folder I make. |
@asolopovas Did you ever solve your permissions issues? And if so how? I have the same issue and have tried everything I can possibly think of but nothing works. Neither |
@hburrows - Did you try my solution above? |
@rmclellan thanks for replying. I did try your solution and it didn't make any difference. It's very baffling. I'm using the setup for plugin development and can function... but it's very frustrating that I can't get it to work properly. I use Docker for all kinds of things so this setup is a natural. Maybe I'd be better off with another virtualization solution for Wordpress development. It must be something simple... what, however, I don't know ??? |
Post your compose file?
…On Fri, Aug 16, 2019, 8:08 PM Howard Burrows, ***@***.***> wrote:
@rmclellan <https://github.com/rmclellan> thanks for replying. I did try
your solution and it didn't make any difference. It's very baffling. I'm
using the setup for plugin development and can function... but it's very
frustrating that I can't get it to work properly. I use Docker for all
kinds of things so this setup is a natural. Maybe I'd be better off with
another virtualization solution for Wordpress development. It must be
something simple... what, however, I don't know ???
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#298?email_source=notifications&email_token=ACDYM2JQIPRWXICDKHUX5ETQE5TRPA5CNFSM4E6QAEW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4QCBQA#issuecomment-522199232>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACDYM2NAX43GYFR35RUE2STQE5TRPANCNFSM4E6QAEWQ>
.
|
@rmclellan Here's my compose file:
|
I'd recommend setting a separate volume directory for the content.
volumes:
vol-wp-db:
vol-wp-content:
wp-db:
image: mariadb:10.3
restart: always
networks:
- backend
volumes:
- vol-wp-db:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ${WORDPRESS_DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${WORDPRESS_DB_NAME}
MYSQL_USER: ${WORDPRESS_DB_USER}
MYSQL_PASSWORD: ${WORDPRESS_DB_PASSWORD}
wp:
image: wordpress:latest
depends_on:
- wp-db
restart: always
networks:
- backend
- frontend
volumes:
- vol-wp-content:/var/www/html/wp-content
- ./php.ini:/usr/local/etc/php/php.ini
environment:
WORDPRESS_DB_HOST: wp-db:3306
WORDPRESS_DB_NAME: ${WORDPRESS_DB_NAME}
WORDPRESS_DB_USER: ${WORDPRESS_DB_USER}
WORDPRESS_DB_PASSWORD: ${WORDPRESS_DB_PASSWORD}
…On Sat, Aug 17, 2019 at 3:52 PM Howard Burrows ***@***.***> wrote:
@rmclellan <https://github.com/rmclellan> Here's my compose file:
version: '3.3'
services:
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: *****
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PASSWORD: wordpress
wordpress:
depends_on:
- db
image: wordpress
ports:
- "8000:80"
restart: always
environment:
WORDPRESS_DB_HOST: db:3306
WORDPRESS_DB_USER: wordpress
WORDPRESS_DB_PASSWORD: ******
WORDPRESS_DB_NAME: wordpress
working_dir: /var/www/html
volumes:
- ./wp-content:/var/www/html/wp-content
- ./uploads.ini:/usr/local/etc/php/conf.d/uploads.ini
volumes:
db_data: {}
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#298?email_source=notifications&email_token=ACDYM2MIUI6TQ7XPWCF5BRLQFB6LNA5CNFSM4E6QAEW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4QU33Y#issuecomment-522276335>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACDYM2P5ITUDRVONJ6XOHALQFB6LNANCNFSM4E6QAEWQ>
.
|
@rmclellan I want to easily work on the files in the volume from my host machine -- i.e. edit them, manage them with github, etc. I'm using this setup for development so being able to point my editor at these files is really important. It doesn't seem like |
I'm not an expert on the binds but wouldn't you have to change the working
directory to add wp-content as well?
…On Sun, Aug 18, 2019 at 8:57 AM Howard Burrows ***@***.***> wrote:
@rmclellan <https://github.com/rmclellan> I want to easily work on the
files in the volume from my host machine -- i.e. edit them, manage them
with github, etc. I'm using this setup for development so being able to
point my editor at these files is really important. It doesn't seem like docker
volume (vs a bind mount) works well for this. Maybe I'm misunderstanding
how docker volume ... works.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#298?email_source=notifications&email_token=ACDYM2JDFS6NLOQ26QCQPFLQFFWP5A5CNFSM4E6QAEW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RC2XY#issuecomment-522333535>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACDYM2INM3PEGBLCGNIK3VLQFFWP5ANCNFSM4E6QAEWQ>
.
|
@rmclellan I'm not following your question. The setup I'm using works perfectly except for the permissions issue which prevents the Wordpress process from writing to |
In your configuration you're binding to a specific existing directory as
opposed to creating a separate volume. However your working directory is a
parent directory of the directory that you're binding. Try changing it to
include the wp-contents.
…On Sun, Aug 18, 2019, 12:05 PM Rob M, ***@***.***> wrote:
I'm not an expert on the binds but wouldn't you have to change the working
directory to add wp-content as well?
On Sun, Aug 18, 2019 at 8:57 AM Howard Burrows ***@***.***>
wrote:
> @rmclellan <https://github.com/rmclellan> I want to easily work on the
> files in the volume from my host machine -- i.e. edit them, manage them
> with github, etc. I'm using this setup for development so being able to
> point my editor at these files is really important. It doesn't seem like docker
> volume (vs a bind mount) works well for this. Maybe I'm misunderstanding
> how docker volume ... works.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#298?email_source=notifications&email_token=ACDYM2JDFS6NLOQ26QCQPFLQFFWP5A5CNFSM4E6QAEW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4RC2XY#issuecomment-522333535>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ACDYM2INM3PEGBLCGNIK3VLQFFWP5ANCNFSM4E6QAEWQ>
> .
>
|
So, if you are running on Windows or OSX and using Docker for Windows/Mac, then the linked issues might be related. While they are specifically about databases having issues with volume mapping from VM to host, I think that the fact the Docker for Windows/Mac presents the files as all root owned is a possible culprit (the first link). Unfortunately, if that is the problem, then the only solution would be to run wordpress as root (which apache httpd and php-fpm don't allow). |
Additionally, in the future, these sorts of questions/requests/discussions would be more appropriately posted to the Docker Community Forums, the Docker Community Slack, or Stack Overflow. |
As in #86 WordPress is asking me for FTP credentials to install plugins.
However, uploading medias works fine, as the uploaded medias appear in
./websites/wp-test/wp-content/uploads
. So the container seems to have write permission on thewp-content
folder.Any idea what could be the problem ?
configuration :
Current directory permissions are :
drwxrwxrwx 1 root root 48 mai 6 15:59 docker/
But as I said, since medias get uploaded I don't see why the plugins can't be downloaded.
Works fine in a directory owned by my current user.
The text was updated successfully, but these errors were encountered: