Sftp not able to connect in magento2.2.5?Magento 2: How to override newsletter Subscriber modelMagento 2 Add new field to Magento_User admin formHow to show product custom attribute next to product in product detail page in magento2.2.5?How to print a product collection in a pdp page in magento2.2.5?How to add upload button for admin cms page in magento2.2.5?Custom admin form saving in database, But not showing in admin grid in Magento2.2.5?Magento2: How to get content of file from remote sftp?Magento2.2.5 amazon_sales_order table does not exist?Could not establish FTP connection, invalid host or port in magento 2.2.5Element 'css': This element is not expected in magento2.2.5

Slide Partition from Rowstore to Columnstore

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

What if you don't bring your credit card or debit for incidentals?

Different PCB color ( is it different material? )

Are there mythical creatures in the world of Game of Thrones?

Is there any Biblical Basis for 400 years of silence between Old and New Testament?

What is a simple, physical situation where complex numbers emerge naturally?

Have powerful mythological heroes ever run away or been deeply afraid?

Is there a rule that prohibits us from using 2 possessives in a row?

Recording the inputs of a command and producing a list of them later on

How can a single Member of the House block a Congressional bill?

What's the most polite way to tell a manager "shut up and let me work"?

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Is the world in Game of Thrones spherical or flat?

Strange math syntax in old basic listing

Do adult Russians normally hand-write Cyrillic as cursive or as block letters?

Asking bank to reduce APR instead of increasing credit limit

Is American Express widely accepted in France?

Modern approach to radio buttons

Relativistic resistance transformation

Can The Malloreon be read without first reading The Belgariad?

Select row of data if next row contains zero

If Sweden was to magically float away, at what altitude would it be visible from the southern hemisphere?

The most awesome army: 80 men left and 81 returned. Is it true?



Sftp not able to connect in magento2.2.5?


Magento 2: How to override newsletter Subscriber modelMagento 2 Add new field to Magento_User admin formHow to show product custom attribute next to product in product detail page in magento2.2.5?How to print a product collection in a pdp page in magento2.2.5?How to add upload button for admin cms page in magento2.2.5?Custom admin form saving in database, But not showing in admin grid in Magento2.2.5?Magento2: How to get content of file from remote sftp?Magento2.2.5 amazon_sales_order table does not exist?Could not establish FTP connection, invalid host or port in magento 2.2.5Element 'css': This element is not expected in magento2.2.5






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I am not able to connect to Sftp in magento2.2.5



Here is my code:



public function execute()
{
$connection = $this->sftp->open(
array(
'host' => 'myhostname',
'username' => 'myusername',
'password' => 'mypassword',
'port' =>22,
'passive' => true
)
);
if($connection)
echo "true";

else
echo "false";

//print_r($connection);
die;


But it is returning false.



I don't know what is the problem.



Any help would be appreciated.










share|improve this question
























  • remove if and else and check by var_dump($this->sftp->ls());

    – Prathap Gunasekaran
    May 24 at 11:23











  • The connection is being listed.. But the connection is failed.

    – Amy
    May 24 at 11:32











  • Are you working on cloud magento ?

    – Chirag Patel
    May 24 at 11:52











  • Yes, I am working on cloud..

    – Amy
    May 24 at 12:07


















0















I am not able to connect to Sftp in magento2.2.5



Here is my code:



public function execute()
{
$connection = $this->sftp->open(
array(
'host' => 'myhostname',
'username' => 'myusername',
'password' => 'mypassword',
'port' =>22,
'passive' => true
)
);
if($connection)
echo "true";

else
echo "false";

//print_r($connection);
die;


But it is returning false.



I don't know what is the problem.



Any help would be appreciated.










share|improve this question
























  • remove if and else and check by var_dump($this->sftp->ls());

    – Prathap Gunasekaran
    May 24 at 11:23











  • The connection is being listed.. But the connection is failed.

    – Amy
    May 24 at 11:32











  • Are you working on cloud magento ?

    – Chirag Patel
    May 24 at 11:52











  • Yes, I am working on cloud..

    – Amy
    May 24 at 12:07














0












0








0








I am not able to connect to Sftp in magento2.2.5



Here is my code:



public function execute()
{
$connection = $this->sftp->open(
array(
'host' => 'myhostname',
'username' => 'myusername',
'password' => 'mypassword',
'port' =>22,
'passive' => true
)
);
if($connection)
echo "true";

else
echo "false";

//print_r($connection);
die;


But it is returning false.



I don't know what is the problem.



Any help would be appreciated.










share|improve this question
















I am not able to connect to Sftp in magento2.2.5



Here is my code:



public function execute()
{
$connection = $this->sftp->open(
array(
'host' => 'myhostname',
'username' => 'myusername',
'password' => 'mypassword',
'port' =>22,
'passive' => true
)
);
if($connection)
echo "true";

else
echo "false";

//print_r($connection);
die;


But it is returning false.



I don't know what is the problem.



Any help would be appreciated.







magento2 magento-2.2.5 ftp






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited May 26 at 22:24









Ayaz Ahmed Khan

13611




13611










asked May 24 at 11:17









AmyAmy

39510




39510












  • remove if and else and check by var_dump($this->sftp->ls());

    – Prathap Gunasekaran
    May 24 at 11:23











  • The connection is being listed.. But the connection is failed.

    – Amy
    May 24 at 11:32











  • Are you working on cloud magento ?

    – Chirag Patel
    May 24 at 11:52











  • Yes, I am working on cloud..

    – Amy
    May 24 at 12:07


















  • remove if and else and check by var_dump($this->sftp->ls());

    – Prathap Gunasekaran
    May 24 at 11:23











  • The connection is being listed.. But the connection is failed.

    – Amy
    May 24 at 11:32











  • Are you working on cloud magento ?

    – Chirag Patel
    May 24 at 11:52











  • Yes, I am working on cloud..

    – Amy
    May 24 at 12:07

















remove if and else and check by var_dump($this->sftp->ls());

– Prathap Gunasekaran
May 24 at 11:23





remove if and else and check by var_dump($this->sftp->ls());

– Prathap Gunasekaran
May 24 at 11:23













The connection is being listed.. But the connection is failed.

– Amy
May 24 at 11:32





The connection is being listed.. But the connection is failed.

– Amy
May 24 at 11:32













Are you working on cloud magento ?

– Chirag Patel
May 24 at 11:52





Are you working on cloud magento ?

– Chirag Patel
May 24 at 11:52













Yes, I am working on cloud..

– Amy
May 24 at 12:07






Yes, I am working on cloud..

– Amy
May 24 at 12:07











1 Answer
1






active

oldest

votes


















0














Kindly install PHP ssh2 extension and then use the following code.



If you get not connected double check your IP is whitelisted or not



$strServer = '*******';
$strServerPort = '*******';
$strServerUsername = '*******';
$strServerPassword = '*******';

//connect to server
$resConnection = ssh2_connect($strServer, $strServerPort);

if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword))

//Initialize SFTP subsystem
echo "connected";

else

echo "not connected";



It works for me.






share|improve this answer

























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f275993%2fsftp-not-able-to-connect-in-magento2-2-5%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Kindly install PHP ssh2 extension and then use the following code.



    If you get not connected double check your IP is whitelisted or not



    $strServer = '*******';
    $strServerPort = '*******';
    $strServerUsername = '*******';
    $strServerPassword = '*******';

    //connect to server
    $resConnection = ssh2_connect($strServer, $strServerPort);

    if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword))

    //Initialize SFTP subsystem
    echo "connected";

    else

    echo "not connected";



    It works for me.






    share|improve this answer





























      0














      Kindly install PHP ssh2 extension and then use the following code.



      If you get not connected double check your IP is whitelisted or not



      $strServer = '*******';
      $strServerPort = '*******';
      $strServerUsername = '*******';
      $strServerPassword = '*******';

      //connect to server
      $resConnection = ssh2_connect($strServer, $strServerPort);

      if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword))

      //Initialize SFTP subsystem
      echo "connected";

      else

      echo "not connected";



      It works for me.






      share|improve this answer



























        0












        0








        0







        Kindly install PHP ssh2 extension and then use the following code.



        If you get not connected double check your IP is whitelisted or not



        $strServer = '*******';
        $strServerPort = '*******';
        $strServerUsername = '*******';
        $strServerPassword = '*******';

        //connect to server
        $resConnection = ssh2_connect($strServer, $strServerPort);

        if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword))

        //Initialize SFTP subsystem
        echo "connected";

        else

        echo "not connected";



        It works for me.






        share|improve this answer















        Kindly install PHP ssh2 extension and then use the following code.



        If you get not connected double check your IP is whitelisted or not



        $strServer = '*******';
        $strServerPort = '*******';
        $strServerUsername = '*******';
        $strServerPassword = '*******';

        //connect to server
        $resConnection = ssh2_connect($strServer, $strServerPort);

        if(ssh2_auth_password($resConnection, $strServerUsername, $strServerPassword))

        //Initialize SFTP subsystem
        echo "connected";

        else

        echo "not connected";



        It works for me.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited May 24 at 11:54

























        answered May 24 at 11:48









        ARUNPRABAKARAN MARUNPRABAKARAN M

        757215




        757215



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f275993%2fsftp-not-able-to-connect-in-magento2-2-5%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form