1

i include the use \Magento\Framework\Filesystem\Io\Ftp; at the top nd connct the ftp as

 $connection = $this->ftp->open(
                    array(
                        'host' => '00.000.00.000',
                        'user' => 'admin',
                        'password' => 'test@123',
                        'passive' => true,
                        'Port'=>21

                    )
                );

this code is work fine in my local environment.. But when am trying with the same code in digitalocean (SFTP) THROWS AN ERROR like

Could not establish FTP connection, invalid host or port.

please help me

  • check from digitalocean, the ip might be blocked by digitalocean firewall – magefms Feb 24 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.