How to stop WordPress asking for ftp details when installing or updating a theme/plugin

Is wordpress asking for ftp credentials, wordpress asking for FTP username and Password when you try to install a plugin or a theme?

Why it happens?

WordPress does not have the necessary permissions to modify the filesystem directly, as its owned by the ftp user or the root user which created the files inside the wordpress directory, Thats why wordpress is asking for the FTP credentials so that it can try to do what it needs to via FTP.

Whats the Solution?

Login to ssh via putty, Run

$ ps aux
wordpress asking for ftp credentials

wordpress asking for ftp credentials

identify the user by which apache / httpd runs in latest version of apache2 the user will be www-data in some it will be other user ( do replace www-data in the below command with corresponding username, also if you are using any other directory for the wordpress installation replace /var/www with that also as well )

$ sudo chown -R /var/www www-data

And you are done.  Now wordpress wont be asking for ftp details while installing or updating themes and plugins or for the core wordpress update. It will do all it itsown 🙂





Leave a Comment.