【发布时间】:2018-08-06 17:41:07
【问题描述】:
我想使用 php 与远程服务器建立 SSH 连接。
我在 Linux/CEntOS 上使用 php 5.3。
到目前为止我做了什么:
$connection = ssh2_connect('192.168.1.22', 22);
ssh2_auth_password($connection, '_username', '_password');
$stream = ssh2_exec($connection, 'ls -l');
但是我收到了这个错误:
致命错误:调用未定义函数 ssh2_connect()
所以,我的问题是:
难道
ssh2_*函数没有默认安装在php中?是否需要扩展或库才能使用这些功能?
我该如何解决这个问题?
【问题讨论】: