[Wordpress on Ubuntu 14.04] FTP credentials aren't working for one site while for other does

Posted March 11, 2015 6.4k views
UbuntuMySQLApachePHPWordPressSecurityLAMP StackConfiguration Management

Ok so.

I have 2 websites. and

On Lenslooter everything works. I can update, add and delete plugins and some plugins can write in wp-config.php and add files to wp-content folder.
ftp host in wp-config is ‘’

I use exact same setting in wp-config for Duki420 and I have weird problems.

I can add and update plugins only when ftp host is '’, but then I can access general settings. I can access general setting when ftp host is set to '’.

So thats the first problem. The second one is that i.e. w3 cache needs to edit wp-config file and add new file called 'advanced-cache.php’ in wp-content folder. On Lenslooter it can, Duki420 it can’t. I use exact same permissions as in Lenslooter.

EDIT: Oh and I am using SSH2 for connecting. Maybe I need another user on server for Auth. keys?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

It sounds like the permissions on your second site’s files could use some adjustment. Wordpress will only prompt for FTP details if it does not have write access to the files it needs to modify. This can be corrected by ensuring that your web files are owned by “www-data”, the user that Apache runs as on an Ubuntu server. You can do this with:

chown -Rf www-data:www-data /var/www/html

Replacing /var/www/html with the directory where your web files are located.

  • AAAAAAAAAWWWWWWWWWWW SHIT thanks man, sorry for swearing but you just saved my nerves.

    It works. Do you suggest that I also put that for lenslooter?

  • I’d recommend setting the ownership to www-data for any wordpress files on each of your sites. It’ll save a lot of headaches :)

  • wooohooo thanks man

  • We were having similar problems- FTP credentials were being asked by WP to install a plugin or update a theme, this suggestion worked perfectly, however we’re wondering if there are any security implications for changed permissions on files and folders within var/www/html. Many thanks.

  • So this suggestion worked for getting around the Wordpress FTP Credentials, but then we noticed that we could no longer use FileZilla to transfer or delete files after we performed this operation, (although the FileZilla application was working perfectly before then for SFTP'ing to the remote server.) There may be no link, however once we removed the modified WordPress install and reinstalled, all was working again with WP and FZ, however we still have the FTP credentials being asked of us again.