Page 1 of 1

SSH connection - how do I disconnect

Posted: Mon Feb 23, 2009 8:24 am
by ubl_
Hi...

I am running PHP 5.2.8 on a windows machine.
I have added the extension "php_ssh2.dll" in order to make SSH connections from PHP.
I am running PHP as a script from a bat-file

I am able to connect, authenticate and execute commands through the SSH connection.

My problem is that I just don't know how to disconnect.

I tried using "unset($connection_ssh);" but when running "netstat -b" the connection is just waiting to be closed and will not be closed until the script is finished.

TCP dkmvpn7aaa:2262 192.168.117.11:ssh CLOSE_WAIT 6692
[php.exe]

If I don't use "unset" the connection is shown as established. (as expected)

How do I disconnect gracefully? (before the script ends)

Kind Regards
Ulrik