I've been struggling with this wordpress FTP issue for the past 3 hour. When trying to update a plugin or wordpress it self it always gives me an error:
ERROR: There was an error connecting to the server, Please verify the settings are correct.
Things that I've done so far: 1. I've sudo chmod -R 777 /var/www/blog 2. I've changed the permission of /var/www/blog to www-data 3. I've configured the following in my wp-config.php:
define( 'FTP_USER', 'username' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', '54.251.103.225' );
I can try to ftp using the username and password above using FileZilla just fine with no issues.I've also tried changing the permission of the blog folder to the 'username' above, no luck. I've also changed the following:
local_enable=YES
write_enable=YES
pasv_enable=YES
pasv_min_port=14000
pasv_max_port=14050
port_enable=YES
pasv_address='my ip address'
pasv_addr_resolve=NO
to my vsftpd.conf, restarted it but no luck. Any ideas on what to do next? Also tried the plugin SSH SFTP Updater Support with no luck
Ok, did you tried define('FS_METHOD', 'DIRECT');
?
Maybe this is not related but I ended up here and it might help others.
I had the same problem, I found a number of solutions in various forums, none of which helped. My credentials were OK but they were being rejected; they worked in Filezilla.
Somewhere I found a reference to a small plugin called 'SSH SFTP Updater Support', which fixed my problem. After installing this the option for SFTP is added and you can choose SSH2 when being challenged for the FTP login details.
Choose SSH2 at the bottom; and I didn't have to fill in anything in the private key box. Plugin deletion worked normally after that.