0

Wordpress asks me for FTP credentials when I try to delete or install plugins. I know it has to do with permissions but I have been unable to figure it out. I have a linux system user XYZ and apache2 run as www-data. This works:

sudo chown www-data:www-data -R /path/to/wordpress
sudo chmod 700 -R /path/to/wordpress

But it's unsafe. My initially planned configuration was:

sudo chown XYZ:www-data -R /path/to/wordpress
sudo chmmod 750 -R /path/to/wordpress
sudo chmod 770 -R /path/to/wordpress/wp-content

According to the wordpress docs, wp-content is the only folder which the webserver should have write-access to. It comprises the plugins and themes folders.

But it doesn't work. I've spent several hours researching online but nothing has helped so far and I don't know what to try anymore. What are the right permissions to allow automated updates and plugin installation, without giving the webserver write-access to everything?

For whatever reason, the following does not work:

sudo chown XYZ:www-data -R /path/to/wordpress
sudo chmod 770 -R /path/to/wordpress

I thought it to be identical to the first variant above, giving www-data write-access to everything. How is this possible??

0

For this issue just edit your config file and add below code that will you:

define('FS_METHOD', 'direct');

Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.