Support » Fixing WordPress » Change FTP Port to 22 from 21 to Install Plugins

  • Hi,

    I was trying to install a plugin in WordPress and it was giving an error message saying that it failed to connect to the FTP server. I did my own troubleshooting and downloaded FileZilla and manually uploaded the plugin. Now I am trying to update the plugin as the version I had uploaded was not up-to-date. Trying to do this through WordPress returns the same error message. I know that the issue has to do with the port, with WordPress trying to connect to port 21, whereas I am needing for it to connect to port 22 (as I connected to port 22 to install the plugin through FileZilla). I tried to upload the new plugin files through FileZilla but it is still saying I don’t have the most recent version in WordPress (the most recent version is the one I downloaded and re-uploaded).

    Being able to upload the most recent version of the plugin would be a start, but I am really looking for a more long term solution as there are other plugins that I am wanting to install that I don’t know how to download to be able to upload into WordPress.

    I have read through the forums and various responses mentioned changing the “wp-config.php”, but I have no idea how to locate that, let alone what to do with it once I’ve found it.

    I am not the most tech savvy, so can you please bear with me and try to explain the solution in the most simple way possible.

    I have also seen feature requests in WordPress asking for the addition of an option to select the port number when entering FTP details. How come this isn’t being developed if it’s a common issue?

    What is frustrating about the whole thing is that I have two other WordPress sites and I don’t encounter the same issues when trying to upload or update plugins.

    Sorry for the long text, hopefully someone is able to help me out.


Viewing 3 replies - 1 through 3 (of 3 total)
  • Hey, port 22 is used for SFTP connection – not FTP. WordPress doesn’t play nice with SFTP, you need a plugin that makes it possible to use SFTP and port 22 for automatic updates.

    Once plugin is active, when you try to upgrade WordPress may ask for your SFTP/SSH login details to perform an upgrade or installation. It will work if you enter it there, but you may need to enter it every single time. To fix this, you should set upgrade constants in wp-config.php file (your SFTP login details). Instructions are here.

    Let me know if that helps or if you get stuck. Thanks.

    Hi Viktor,

    First, thanks for taking the time to respond.

    How do I locate config.php to be able to upgrade the constants?

    With the plugin you recommend, how would that work? I would install it and then I’d be able to install and update plugins directly in WordPress?

    Thanks again for your help,

    Hey Alex,

    wp-config.php is located inside your root folder, that’s where you can add all those constants. If your hosting is cPanel, it’s usually in public_html folder.

    And yes, you will need to add this plugin manually since automatic installation does not work yet. Once you add it, activate it, add the constants, and try upgrading/installing. It should work now without any issues. If there are any issues, do let me know and we’ll try to fix them too.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change FTP Port to 22 from 21 to Install Plugins’ is closed to new replies.