SSH功能不存在

I try create user with SSH, but in website I get this error: function ssh2_connect doesn't exist. What can I do?

My all code:

    <?php
if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
if (!($con = ssh2_connect("77.241.202.58", 22))) 
{
    echo "Klaida
";
} 
else 
{
    if (!ssh2_auth_password($con, "root", "pass")) {
        echo "Negalima
";
    } else {
        // allright, we're in!
        echo "Prisijungta
";

    }
}
?>
doudou1897
doudou1897 你在Windows或Linux上吗?在任何情况下,您可能需要自己编译或下载内置版本(仅适用于特定版本)。
7 年多之前 回复

2个回答



我的建议:使用 phpseclib ,一个纯PHP SSH2实现。 尝试安装libssh2非常困难,而且phpseclib通常只是更好:</ p>

https:/ /stackoverflow.com/a/14305875/569976 </ p>
</ div>

展开原文

原文

My recommendation: use phpseclib, a pure PHP SSH2 implementation. Trying to install libssh2 is quite difficult and phpseclib is often just plain better anyway:

https://stackoverflow.com/a/14305875/569976



您的服务器上缺少OpenSSL或libssh2: http://www.php.net/manual/en/ssh2.requirements.php </ p>
</ div>

展开原文

原文

You are missing OpenSSL or libssh2 on your server: http://www.php.net/manual/en/ssh2.requirements.php

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问