Skip to content

Instantly share code, notes, and snippets.

@dianjuar
Last active April 16, 2024 12:21
Show Gist options
  • Star 88 You must be signed in to star a gist
  • Fork 26 You must be signed in to fork a gist
  • Save dianjuar/1b2c43d38d76e68cf21971fc86eaac8e to your computer and use it in GitHub Desktop.
Save dianjuar/1b2c43d38d76e68cf21971fc86eaac8e to your computer and use it in GitHub Desktop.
Install update WordPress plugins without providing ftp access

Install WordPress plugins directly (without FTP)

Put this on your wp-config.php

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

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

@omgkotofey
Copy link

omgkotofey commented Mar 19, 2020

Thanks a lot, you saved me hours)

@axclever
Copy link

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

fpscan commented May 6, 2020

This also worked for me.

@koebelma1992
Copy link

koebelma1992 commented May 20, 2020

Thanks guys, nice solution!

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

@protekshen
Copy link

Thanks a lot!

@protekshen
Copy link

protekshen commented Nov 1, 2020

I'm using docker for wordpress development.
For me, works next:

I added define('FS_METHOD', 'direct'); to function.php file of my theme.

And then:

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

@thatnerdjosh
Copy link

Because of this PR, there is no need to change the permissions within the container :)

docker-library/wordpress#249

@ramaID
Copy link

ramaID commented Jun 21, 2022

thanks so much!

@IngoGutwin
Copy link

thank's a bunch ! works perfect

@trainingcity
Copy link

Thanks!

@aymane-smi
Copy link

very helpful, thanks Diego!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment