Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use sftp instead of ftp when updating wordpress plugins?

Website Information:

Protocol : SFTP

Server : Google Cloud

Wordpress Version : 4.9.8

I am trying to update my WordPress plugins but every time I try to do it, it always asks me for my FTP information but when I supplied my FTP information it returns an error 'Failed to connect to FTP Server.'

I even tried to add Port number '21' and '22' on the hostname but it still doesn't work. I even tried using 'FTPS (SSL)' Connection type but it didn't work either. I've also used the plugin 'SSH SFTP Updater Support' but it leaves my website under maintenance and I can't access it anymore.

I've spent 2 days resolving this problem. Hope that someone can help me with this.

Thank you in advance :)

like image 911
Oliver Primo Avatar asked Oct 29 '25 00:10

Oliver Primo


1 Answers

If only FTP and FTPS (SSL) appear as options on WordPress when installing plugins, etc., then installing the PHP extension for SSH2 will automatically add an SSH2 option (for SFTP) to WordPress.

For example, on Ubuntu:

sudo apt install php-ssh2

And restart the web server (e.g. Nginx or Apache).

like image 192
jmg Avatar answered Oct 30 '25 23:10

jmg