PHP 函数 ssh2_connect 不起作用 [英] PHP function ssh2_connect is not working

查看:33
本文介绍了PHP 函数 ssh2_connect 不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的脚本:

    <?php
    $connection = ssh2_connect('XX.XX.XX.XX', 22);
    ssh2_auth_password($connection, 'root', '******');

    $stream = ssh2_exec($connection, 'useradd -d /home/users/test -m testftp');
    $stream = ssh2_exec($connection, 'passwd testftp');
    $stream = ssh2_exec($connection, 'password');
    $stream = ssh2_exec($connection, 'password');
    ?>

它显示以下错误:

Fatal error: Call to undefined function ssh2_connect() in /home/chaosnz/public_html/fotosnap.net/test.php on line 2

我该如何处理?

谢谢

推荐答案

我已经安装了 SSH2 PECL 扩展并且它工作正常,感谢大家的帮助...

I have installed the SSH2 PECL extension and its working fine thanks all for you help...

这篇关于PHP 函数 ssh2_connect 不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆