For security reasons, none is disabled by the underlying
» libssh2 library unless explicitly enabled
during build time by using the appropriate ./configure options. See documentation
for the underlying library for more information.

callbacks

callbacks may be an associative array with any
or all of the following parameters.

Callbacks parameters

Index
Meaning
Prototype

ignore

Name of function to call when an
SSH2_MSG_IGNORE packet is received

void ignore_cb($message)

debug

Name of function to call when an
SSH2_MSG_DEBUG packet is received

void debug_cb($message, $language, $always_display)

macerror

Name of function to call when a packet is received but the
message authentication code failed. If the callback returns
TRUE, the mismatch will be ignored, otherwise the connection
will be terminated.

bool macerror_cb($packet)

disconnect

Name of function to call when an
SSH2_MSG_DISCONNECT packet is received

void disconnect_cb($reason, $message, $language)

Возвращаемые значения

Returns a resource on success, or FALSE on error.

Примеры

Пример #1 ssh2_connect() example

Open a connection forcing 3des-cbc when sending packets, any strength
aes cipher when receiving packets, no compression in either direction,
and Group1 key exchange.