Wordpress on Ubuntu install plugins without FTP access

Viewed 11467

I run my own web server for development and, on it, I installed a WordPress instance. When I try to add plugins to this instance from the admin interface, WordPress asks for FTP access.

I don't use FTP and have no plans to do so in the future. I know I can change some configuration in WordPress so that I am able to upload without FTP. What exactly should I configure to accomplish this?

5 Answers

I was not satisfied with any of these answers so I kept on searching. I found an answer that was so simple I was surprised it had not been mentioned already.

https://askubuntu.com/a/826805/145472

This answer says to add a line to wp-config.php

define('FS_METHOD', 'direct');

Job done. I cannot take credit for knowing this but I do feel it needs a mention here too.

One way to do it is change assign ownership of the wordpress installation to www-data:

chown -R www-data:www-data .

Change file permissions:

chmod -R g+rwX .

Add yourself to the www-data group:

usermod -a -G www-data myusername
Related