【发布时间】:2019-08-23 06:52:35
【问题描述】:
我尝试在我的应用程序中运行 SSH 连接并收到此错误:
Call to undefined function App\Http\Controllers\Admin\ssh2_connect()
Controller
public function save(Request $request){
$ip = $request->input('server_ip');
$sshUser= $request->input('server_ssh_user');
$sshPw = $request->input('server_ssh_password');
$sshConnection = ssh2_connect($ip, 22);
//rest of the code which doesn't execute as result of line above returns error
有什么想法吗?
【问题讨论】:
-
ssh2函数是可选扩展。你安装了吗? php.net/manual/en/ssh2.installation.php -
(另外,考虑类似phpseclib,其中有一个Laravel package,或Laravel Envoy。)
-
@ceejayoz 没有没有安装那个。我应该将它安装在我的系统上还是使用 Composer 将它添加到我的应用程序中?
-
@ceejayoz 我已经安装了github.com/LaravelCollective/docs/blob/5.6/ssh.md#installation
-
希望对您有所帮助Link