我尝试在应用程序中运行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
有什么想法吗?
答案 0 :(得分:0)
您需要在服务器上安装以下软件包。
Ubuntu / Debian:
sudo apt-get install php-ssh2
sudo service apache2 restart
Redhat / Centos / Amazon-Linux:
sudo yum install php-ssh2
sudo service httpd restart (Centos/Redhat/AmazonLinux)