PHP.mk документација

ssh2_disconnect

Почист и полокален преглед на PHP референцата, со задржана структура од PHP.net и подобра читливост за примери, секции и белешки.

function.ssh2-disconnect.php PHP.net прокси Преводот се освежува
Оригинал на PHP.net
Патека function.ssh2-disconnect.php Локална патека за оваа страница.
Извор php.net/manual/en Оригиналниот HTML се реупотребува и локално се стилизира.
Режим Прокси + превод во позадина Кодовите, табелите и белешките остануваат читливи во истиот тек.
ssh2_disconnect

Референца за `function.ssh2-disconnect.php` со подобрена типографија и навигација.

function.ssh2-disconnect.php

ssh2_disconnect

(PECL ssh2 >= 1.0)

ssh2_disconnect(PECL ssh2 >= 1.0)

= NULL

ssh2_disconnect(resource $session): bool

Затвори врска со оддалечен SSH сервер

Параметри

session
Барај SFTP подсистем од веќе поврзан SSH2 сервер. ssh2_connect().

Вратени вредности

Патеката до PHP скриптата што треба да се провери. true на успех или false при неуспех.

Види Исто така

Белешки од корисници 3 белешки

Затвори врска со оддалечен SSH сервер.
пред 7 години
ssh2_disconnect(...) requires at least PHP 7 (as it requires PECL ssh2 >= 1.0, which the PECL documentation on https://pecl.php.net/package/ssh2 states: "ssh2 1.0 and above is PHP 7 only").

For PHP 5.x similar functionality, try setting the ssh2_connect session variable to null, or unsetting it completely - this should allow PHP's garbage collection close the connection.

Example:

$session=ssh2_connect(...); // open connection
// code here to use connection
$session = null; unset($session); // close connection
Cavallo
пред 2 години
If you derive an sftp connection from an ssh connection you must close the sftp connection before closing the ssh connection if you use ssh2_dissconnect. In other words:

<?php
$ssh_con=ssh2_connect($sftp_server);
ssh2_auth_password($ssh_con, $sftp_user, $sftp_pass);
$scp_con=ssh2_sftp($ssh_con);

# do stuff with $scp_con

ssh2_disconnect($scp_con);
ssh2_disconnect($ssh_con);
?>
Peter Roes
пред 5 години
This function worked fine as long as I didn't use any ssh2_sftp* stuff. As soon as I did, the connection (from my webserver to my browser) was closed without any warning/error in any of the logfiles. So, this won't work

<?php
// ssh2_connect and ssh2_auth etc...
$sftp = ssh2_sftp($connection);
ssh2_disconnect(); // Causes the connection to be reset
?>

while this works

<?php
// ssh2_connect and ssh2_auth etc...
$sftp = ssh2_sftp($connection);
$connection = null; unset($connection);
?>
На оваа страница

Автоматски outline од активната документација.

Насловите ќе се појават тука по вчитување.

Попрегледно читање

Примерите, changelog табелите и user notes се визуелно издвоени за да не се губат во долгата содржина.

Брз совет Користи го outline-от Скокни директно на главните секции од активната страница.
Извор Оригиналниот линк останува достапен Кога ти треба целосен upstream context, отвори го PHP.net во нов tab.