Php ssh2 extensions are installed normally, but cannot connect to the target host

Source: Internet
Author: User
{Code ...} the above is my code. The platform I use is lnmp, And the ssh2 extension has been installed normally, because no error is reported using the ssh2_connect function, and I also ensure the Host IP address and user name, the password is correct, but two consecutive errors are output, that is, on the connect host...
$link=ssh2_connect($host,22);if(!$link){echo"error";}$link1=ssh2_auth_password($link,$user,$pwd);if(!$link1){echo"error";}

The above is my code. The platform I use is lnmp, And the ssh2 extension has been installed normally, because no error is reported using the ssh2_connect function, and I also ensure the Host IP address and user name, the password is correct, but two errors are still output consecutively. That is to say, an error has occurred while connecting the host. Where is the error? Is it because the supporting software required by ssh2 is not installed?
Please explain how to install the lnmp Platform)

Reply content:
$link=ssh2_connect($host,22);if(!$link){echo"error";}$link1=ssh2_auth_password($link,$user,$pwd);if(!$link1){echo"error";}

The above is my code. The platform I use is lnmp, And the ssh2 extension has been installed normally, because no error is reported using the ssh2_connect function, and I also ensure the Host IP address and user name, the password is correct, but two errors are still output consecutively. That is to say, an error has occurred while connecting the host. Where is the error? Is it because the supporting software required by ssh2 is not installed?
Please explain how to install the lnmp Platform)

Ask how to install ssh2 extension on the lnmp Platform

I also have this problem, but I don't know if it solves it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.