Fix For WordPress Asking FTP Login Details

Fix For WordPress Asking FTP Login Details

When handling any WordPress site you might come across situation where you promoted FTP login details of current host. In past, I worked on servers when it was common thing. This is actually a very good method to stop attackers/hackers to upload payloads on website or get access of files to do nasty hacking things. And it has been proven method along with rest of the security methods we take care of while handling any WordPress site. But in some cases it has to be implemented by webmasters and users need rescue from it. I found below method to allow our-self to get rid of FTP prompts. You will need to use Putty to apply commands and update wp-config.php page.

First you edit wp-config.php using vi editor and all below directive below all scripts on page

define('FS_METHOD','direct');

Initially, FTP asks password because WordPress itself has to be update the files & do actions of its own. But site hosting on Apache is its base owner. So it will not allow other user or wordpress to do changes. For this, you have to gain permission for every updates. Later on you switch to its original after all your updates. if you are running on apache2 then below code will work

sudo chown -R <user>:www-data <WordPress-directory>

<user>: your username

www-data: apache2 group

I hope it will solve your issues with FTP asking for password.

Leave a Reply

Your email address will not be published. Required fields are marked *

Show Buttons
Hide Buttons
%d bloggers like this: