以下是我的脚本:
<?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 扩展并且它工作正常感谢大家的帮助...
关于PHP 函数 ssh2_connect 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14050231/