Domanda

I have WordPress installed on AWS with EC2. I can connect via SFTP using FileZilla but if I try to update a plugin from within WordPress it asks me for the FTP details and I get the following error message:

ERROR: There was an error connecting to the server, Please verify the settings are correct.

I've read a lot of threads on here and followed a lot of steps to try to rectify, including:

  • added 2 new inbound Custom TCP rules to the EC2 Security Group; one for port 21 and one for ports 0-65000
  • added the following to my wp-config.ini:

    define('FS_METHOD', 'ftpext');
    define('FTP_BASE', '/var/www/');
    define('FTP_CONTENT_DIR', '/var/www/wp-content/');
    define('FTP_PLUGIN_DIR ', '/var/www/wp-content/plugins/');
    define('FTP_USER', 'ubuntu');
    define('FTP_PASS', 'my_password_obviously');
    define('FTP_HOST', 'my.ip.obviously');
    define('FTP_SSL', false);
    

still no luck. can anyone help?

Thanks Sean

È stato utile?

Soluzione

Since you are on ec2, you have full control of your instance. You can use direct setting for FS_METHOD as a means of updating the core and any plugins.

Although keep in mind that this can be somewhat insecure if you do not properly configure your instance (The webserver user should be isolated). You would also want to be sure that you can trust the plugins your are installing.

Altri suggerimenti

Amazon EC2 has some issues with FTP. See here for a solution to this common issue. However, this may not be your best solution. I go by the philosophy that the fewer ports I can open, the safer I am. Even if you are keeping it open only to your local IP, you are not completely safe from a DoS or some other malicious attack. Multiple checks are better than one, and fewer ports are better than more.

The issue is that FTP is that it was designed and implemented prior to any of today's security concerns. While you can make FTP more secure, and there are solutions on the web for this (like the one above), a better - and possibly MUCH easier - solution could be found in allowing FTPS over Port 22. Evidently, by installing and activating some packages you may be able to open Wordpress updates to a new option.

See here (not tested by me) for the FTPS solution which runs through Port 22 by binding to PHP through libssh2-php on Debian (or these steps on CentOS).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top