Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Install update WordPress plugins without providing ftp access

Install WordPress plugins directly (without FTP)

Ref Stack Overflow Comment

Put this on your wp-config.php

/* That's all, stop editing! Happy blogging. */
define('FS_METHOD', 'direct');
@dwthomson

This comment has been minimized.

Copy link

dwthomson commented Jan 27, 2019

how do you update your wp-config file in the docker container, can only see wp-content in the volume?

@llucasshenrique

This comment has been minimized.

Copy link

llucasshenrique commented Mar 1, 2019

how do you update your wp-config file in the docker container, can only see wp-content in the volume?

Execute the bash attached on your container
docker exec -it <CONTAINER ID> /bin/bash
it should leave you at the working directory, if no just navigate to where the wordpress are installed and use vim, or you editor of preference.

@dianjuar

This comment has been minimized.

Copy link
Owner Author

dianjuar commented Jun 16, 2019

You can also share volumes and edited in the host. I prefer that technique

@nguyenlamlll

This comment has been minimized.

Copy link

nguyenlamlll commented Nov 7, 2019

Thank a lot for your gist!
I 'bypassed' the FTP credential page but got blocked by "Could not create directory" after the installation had finished.

For people with Docker, log into interactive session of your container:

docker exec -u root -it {CONTAINER_ID} /bin/bash
chown -R www-data wp-content
chmod -R 755 wp-content

Reference

@KalanaPerera

This comment has been minimized.

Copy link

KalanaPerera commented Jan 22, 2020

@nguyenlamlll Thank you.

@ltancerel

This comment has been minimized.

Copy link

ltancerel commented Feb 12, 2020

Great thanks for this, it worked for me with both indications in my docker

@omgkotofey

This comment has been minimized.

Copy link

omgkotofey commented Mar 19, 2020

Thanks a lot, you saved me hours)

@aclever

This comment has been minimized.

Copy link

aclever commented Apr 2, 2020

For me FS_METHOD: direct works only with permission www-data.

Try to change permissions for wp-content to www-data or add your user to www-data group.
sudo adduser ${USER} www-data

@fpscan

This comment has been minimized.

Copy link

fpscan commented May 6, 2020

This also worked for me.

@koebelma1992

This comment has been minimized.

Copy link

koebelma1992 commented May 20, 2020

Thanks guys, nice solution!

(after transfering wordpress to another host, i had this problems).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.