我已经使用 ssh2_connect
通过 ssh2 连接到服务器,但我没有看到任何方法 in the manpages我应该如何结束连接。
我不喜欢在断开连接之前等待脚本结束。
我可以使用 fclose
吗?这听起来不对……
最佳答案
只是unset($connection)
您的连接变量或 ssh2_exec($connection, 'exit');
可能会这样做。
为了更有说服力,您可能会执行以下操作!
ssh2_exec($connection, 'exit');
unset($connection);
关于php - 从 ssh2_connect() 断开连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5820089/